Add unittest.
This commit is contained in:
16
tests/ptr-arith-indexing.ispc
Normal file
16
tests/ptr-arith-indexing.ispc
Normal file
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user