Skip to content

Commit ba2c2dc

Browse files
committed
Add test cases for 0X-style hex literals
Add tests to verify valid and invalid forms of hex literals.
1 parent 49bcd8b commit ba2c2dc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/driver.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,4 +1855,32 @@ int main(void)
18551855
}
18561856
EOF
18571857

1858+
try_output 0 "2748 6719 105884 0" << EOF
1859+
int main()
1860+
{
1861+
int a = 0XABC;
1862+
int b = 0X1a3f;
1863+
int c = 0XDEaD + 0xBeEF;
1864+
int d = 0X0;
1865+
printf("%d %d %d %d", a, b, c, d);
1866+
return 0;
1867+
}
1868+
EOF
1869+
1870+
try_compile_error << EOF
1871+
int main()
1872+
{
1873+
int x = 0X;
1874+
return 0;
1875+
}
1876+
EOF
1877+
1878+
try_compile_error << EOF
1879+
int main()
1880+
{
1881+
int x = 0XGHI;
1882+
return 0;
1883+
}
1884+
EOF
1885+
18581886
echo OK

0 commit comments

Comments
 (0)