From 31c704f2ba5588e0612158ea016552debf09ee98 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 12 Apr 2024 17:07:40 -0700 Subject: Fix micro expansion issue for __LINE__. (#3942) --- tests/preprocessor/line-macro.slang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/preprocessor/line-macro.slang (limited to 'tests/preprocessor') diff --git a/tests/preprocessor/line-macro.slang b/tests/preprocessor/line-macro.slang new file mode 100644 index 000000000..2b035357a --- /dev/null +++ b/tests/preprocessor/line-macro.slang @@ -0,0 +1,14 @@ +//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -output-using-type + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer outputBuffer : register(u0); + +#define T(x) x +#define LL T(__LINE__) + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + // CHECK: 13 + outputBuffer[0] = LL; +} \ No newline at end of file -- cgit v1.2.3