summaryrefslogtreecommitdiff
path: root/tests/ir/string-literal-hash-reflection.slang
blob: 44a0f36e958da740172c4b004a91904a5d0b3f49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//TEST:REFLECTION(filecheck=CHECK):-stage compute -entry computeMain -target hlsl -no-codegen

// CHECK-DAG: "Hello \t\n\0x083 World": -215446506
// CHECK-DAG: "Try another": 900483678

import string_literal_module;

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> outputBuffer;

[numthreads(4, 1, 1)]
void computeMain(
    uint tid   : SV_DispatchThreadIndex)
{
    int value = doSomethingElse() + getStringHash("Hello \t\n\0x083 World");   
    outputBuffer[tid] = value;
}