diff --git a/tests/ptr-arith-indexing.ispc b/tests/ptr-arith-indexing.ispc new file mode 100644 index 00000000..9f62a2c9 --- /dev/null +++ b/tests/ptr-arith-indexing.ispc @@ -0,0 +1,16 @@ + +export uniform int width() { return programCount; } + +int foo(uniform float * uniform base, uniform int uOfs, varying int vOfs) { + return (base+uOfs)[vOfs]; +} + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float * uniform ptr = &aFOO[0]; + int val = foo(ptr, programCount, programIndex); + RET[programIndex] = val; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1+programCount+programIndex; +}