diff options
Diffstat (limited to 'tests/language-feature/modules')
| -rw-r--r-- | tests/language-feature/modules/module-name.slang | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/language-feature/modules/module-name.slang b/tests/language-feature/modules/module-name.slang new file mode 100644 index 000000000..32e8c70d2 --- /dev/null +++ b/tests/language-feature/modules/module-name.slang @@ -0,0 +1,24 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type + +// Test that decls with the same name as the module are allowed. + +module MyModule; + +struct MyModule +{ + int doThing() + { + return 1; + } +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=output +RWStructuredBuffer<int> output; + +void computeMain() +{ + MyModule m; + output[0] = m.doThing(); + // CHECK: 1 +} |
