From 013bcf28da22fd569154bd9f98368e670fbeb873 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 25 Jan 2024 17:47:40 -0800 Subject: Fixes for `module` and `include`. (#3519) * Fix type checking of enum cases. * Allow decl to have same name as module. --------- Co-authored-by: Yong He --- tests/language-feature/modules/module-name.slang | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/language-feature/modules/module-name.slang (limited to 'tests') 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 output; + +void computeMain() +{ + MyModule m; + output[0] = m.doThing(); + // CHECK: 1 +} -- cgit v1.2.3