summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/modules/module-name.slang
blob: 933435f7fed41d0021372ed67aea3094a5a3194b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu -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
}