ispc/ispc — Issue #130: Complex pointer declaration causes assertion failure
Author: mmp
Created: 2011-12-05 17:39:14+00:00
State: open
Labels: bugs

The line

```
uniform int (* varying y)[10] = x;
```

In this test:

```

export uniform int width() { return programCount; }

export void f_f(uniform float RET[], uniform float aFOO[]) {
uniform int x[2][10];
for (uniform int i = 0; i < 2; ++i) {
for (uniform int j = 0; j < 10; ++j) {
x[i][j] = 10*i+j;
}
}

uniform int (* varying y)[10] = x;
RET[programIndex] = y[1][programIndex % 5];
}

export void result(uniform float RET[]) {
RET[programIndex] = 10+ (programIndex % 5);
}
```

Causes an LLVM assertion to trigger: Assertion failed: (isa(Val) && "cast() argument of incompatible type!"), function cast, file /Users/mmp/llvm-3.0/include/llvm/Support/Casting.h, line 194.