From 0b46715bff7f047fefed303ae149d3de8eb6be4f Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 21 Feb 2024 13:59:30 -0800 Subject: Fix parsing of literals in stdlib. (#3610) * Fix parsing of literals in stdlib. * Fix double lit limits. --- tests/bugs/gh-3589.slang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/bugs/gh-3589.slang (limited to 'tests') diff --git a/tests/bugs/gh-3589.slang b/tests/bugs/gh-3589.slang new file mode 100644 index 000000000..58bb74f37 --- /dev/null +++ b/tests/bugs/gh-3589.slang @@ -0,0 +1,18 @@ +//TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry main -profile cs_6_0 +RWStructuredBuffer outputBuffer; +RWStructuredBuffer outputBuffer2; + +void main(uint id: SV_DispatchThreadID) +{ + let i = int64_t.maxValue; + let m = int64_t.minValue; + // CHECK: 9223372036854775807LL + // CHECK: -9223372036854775808LL + outputBuffer[0] = i; + outputBuffer[1] = m; + + // CHECK: -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 + outputBuffer2[0] = double.minValue; + // CHECK: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 + outputBuffer2[1] = double.maxValue; +} \ No newline at end of file -- cgit v1.2.3