diff options
Diffstat (limited to 'tests/metal/empty-struct-remove.slang')
| -rw-r--r-- | tests/metal/empty-struct-remove.slang | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/metal/empty-struct-remove.slang b/tests/metal/empty-struct-remove.slang new file mode 100644 index 000000000..2d9ee436b --- /dev/null +++ b/tests/metal/empty-struct-remove.slang @@ -0,0 +1,33 @@ + +//TEST:SIMPLE(filecheck=LIB):-target metallib -entry computeMain -stage compute -DMETAL +//TEST:SIMPLE(filecheck=METAL):-target metal -entry computeMain -stage compute -DMETAL + +// METAL-NOT: struct emptyStruct +struct emptyStruct +{ + void set(RWStructuredBuffer<int> buffer, int value) {buffer[0] = value;} +} + + +struct MyStruct +{ + RWStructuredBuffer<int> buffer; + int value; + void set() + { + e.set(buffer, value); + } + emptyStruct e; +} + +ParameterBlock<MyStruct> param; + +// LIB: @computeMain +[shader("compute")] +[numthreads(1, 1, 1)] +void computeMain( + uint tid: SV_DispatchThreadID, +) +{ + param.set(); +} |
