Skip to content

Commit a36c049

Browse files
committed
Adding more test case
1 parent d69ae14 commit a36c049

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/diagnostics/uninitialized-variable-name-in-error-message.slang

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
RWStructuredBuffer<float> gInput;
77
RWStructuredBuffer<float> outputBuffer;
88

9+
//CHK-DAG: ([[#@LINE+1]]): warning 41016: use of uninitialized variable 'a'
10+
float func1() { float a; return a; }
11+
12+
//CHK-DAG: ([[#@LINE+1]]): warning 41016: use of uninitialized variable 'b'
13+
float func2() { float b; return b; }
14+
915
int test(int inVal)
1016
{
1117
return inVal;
@@ -20,7 +26,7 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
2026

2127
for (int i = 0; i <2; ++i)
2228
{
23-
// CHK: ([[#@LINE+1]]): warning 41016: use of uninitialized variable 'inVal'
29+
// CHK-DAG: ([[#@LINE+1]]): warning 41016: use of uninitialized variable 'inVal'
2430
int outVal = test(inVal);
2531
outputBuffer[tid] = outVal;
2632
}

0 commit comments

Comments
 (0)