diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-14 18:01:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-14 18:01:31 -0700 |
| commit | 4edc72e4dea47cf549b4e28940e3509a5ab61439 (patch) | |
| tree | 10475236b4a0e1f8a7a0bafdaa05a09d26f9412f /tests | |
| parent | d76bed6c1b03e5d7ef19c947fdd5fcaf33b595f7 (diff) | |
Remove use of `G0` and `__target_intrinsic` in stdlib. (#4170)
* Remove use of `G0` and `__target_intrinsic` in stdlib.
* Fix.
* Fix calling intrinsic in global scope.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cuda/cuda-array-layout.slang | 2 | ||||
| -rw-r--r-- | tests/cuda/cuda-array-layout.slang.expected.txt | 2 | ||||
| -rw-r--r-- | tests/glsl-intrinsic/intrinsic-basic.slang | 2 | ||||
| -rw-r--r-- | tests/spirv/global-compute.slang | 12 |
4 files changed, 16 insertions, 2 deletions
diff --git a/tests/cuda/cuda-array-layout.slang b/tests/cuda/cuda-array-layout.slang index 7fee3b192..60f318962 100644 --- a/tests/cuda/cuda-array-layout.slang +++ b/tests/cuda/cuda-array-layout.slang @@ -29,4 +29,6 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) outputBuffer[2] = __offsetOf(s, s.b); outputBuffer[3] = __offsetOf(s, s.c); outputBuffer[4] = __offsetOf(s, s.d); + + outputBuffer[5] = __sizeOf<int>(); } diff --git a/tests/cuda/cuda-array-layout.slang.expected.txt b/tests/cuda/cuda-array-layout.slang.expected.txt index bc3e8bd6c..e8c73d791 100644 --- a/tests/cuda/cuda-array-layout.slang.expected.txt +++ b/tests/cuda/cuda-array-layout.slang.expected.txt @@ -4,6 +4,6 @@ type: int32_t 16 20 44 -0 +4 0 0 diff --git a/tests/glsl-intrinsic/intrinsic-basic.slang b/tests/glsl-intrinsic/intrinsic-basic.slang index 6bd4e7fe0..82c7d142c 100644 --- a/tests/glsl-intrinsic/intrinsic-basic.slang +++ b/tests/glsl-intrinsic/intrinsic-basic.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK_GLSL): -allow-glsl -stage compute -entry computeMain -target glsl -//TEST:SIMPLE(filecheck=CHECK_GLSL_SPIRV): -allow-glsl -stage compute -entry computeMain -target spirv +//TEST:SIMPLE(filecheck=CHECK_GLSL_SPIRV): -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-via-glsl //TEST:SIMPLE(filecheck=CHECK_SPIR): -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-directly //TEST:SIMPLE(filecheck=CHECK_HLSL): -allow-glsl -stage compute -entry computeMain -target hlsl diff --git a/tests/spirv/global-compute.slang b/tests/spirv/global-compute.slang new file mode 100644 index 000000000..1af3bfe5b --- /dev/null +++ b/tests/spirv/global-compute.slang @@ -0,0 +1,12 @@ +//TEST:SIMPLE(filecheck=CHECK): -stage compute -target spirv -emit-spirv-directly -entry main + +RWStructuredBuffer<float> output; +static const int vmin = min(1,2); + +// CHECK: OpEntryPoint + +[numthreads(1,1,1)] +void main() +{ + output[0] = vmin; +} |
