diff --git a/tests/movmsk-opt.ispc b/tests/movmsk-opt.ispc deleted file mode 100644 index 6a360dff..00000000 --- a/tests/movmsk-opt.ispc +++ /dev/null @@ -1,35 +0,0 @@ -static float float4(uniform float a, uniform float b, uniform float c, - uniform float d) { - float ret = 0; - for (uniform int i = 0; i < programCount; i += 4) { - ret = insert(ret, i + 0, a); - ret = insert(ret, i + 1, b); - ret = insert(ret, i + 2, c); - ret = insert(ret, i + 3, d); - } - return ret; -} - -export uniform int width() { return programCount; } - - - -export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) { - float a = aFOO[programIndex]; - uniform int ret = 0; - - float v = float4(1,1,0,0); - bool b = (v == 1.); - ret = __movmsk((sign_extend(b))); - RET[programIndex] = ret; -} - - -// fixme for 16-wide... -export void result(uniform float RET[]) { - uniform int x = -1234; - if (programCount == 4) x = 3; - else if (programCount == 8) x = 0x33; - else if (programCount == 16) x = 0x3333; - RET[programIndex] = x; -} diff --git a/tests_errors/struct_type_equality.ispc b/tests_errors/struct_type_equality.ispc new file mode 100644 index 00000000..26fe80f4 --- /dev/null +++ b/tests_errors/struct_type_equality.ispc @@ -0,0 +1,14 @@ +// Can't convert between different struct types "uniform struct Foo" and "uniform struct Bar" + +struct Foo { + int a; +}; + +struct Bar { + int x; +}; + +void f(Foo a) { + Bar b; + b =a; +} diff --git a/type.cpp b/type.cpp index cbc011a1..5502d039 100644 --- a/type.cpp +++ b/type.cpp @@ -2448,6 +2448,8 @@ lCheckTypeEquality(const Type *a, const Type *b, bool ignoreConst) { if (sta != NULL && stb != NULL) { if (sta->GetElementCount() != stb->GetElementCount()) return false; + if (sta->GetStructName() != stb->GetStructName()) + return false; for (int i = 0; i < sta->GetElementCount(); ++i) if (!lCheckTypeEquality(sta->GetElementType(i), stb->GetElementType(i), ignoreConst))