scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 6b08a16dbf2e47ec630fd0f1dd575e82a5feb182
parent c3ea36274bc6d11ed47c11275e3c8bb64291c101
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  7 Oct 2015 17:29:52 +0200

Add test for integer constants

There are some ugly rules in C99 about the type of integer
constants, and this test try to check them.

Diffstat:
cc1/tests/test039.c | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+), 0 deletions(-)

diff --git a/cc1/tests/test039.c b/cc1/tests/test039.c @@ -0,0 +1,58 @@ + +/* +name: TEST039 +description: Test of integer constants +comments: This test is done for z80 sizes +output: +F1 I +G2 F1 main +{ +\ +A3 I i +A4 N u +A5 W l +A6 Z ul +A7 Q ll +A8 O ull + A3 #I1 :I + A3 #I1 :I + A4 #N1 :N + A4 #N1 :N + A5 #W1 :W + A5 #W0 :W + A4 #N0 :N + A6 #Z1 :Z + A5 #W1 :W + A7 #Q0 :Q + A6 #Z0 :Z + A8 #O1 :O + A8 #O1 :O + r #I0 +} +*/ + +int +main(void) +{ + int i; + unsigned u; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + + i = 1; + i = 1u; + u = 1u; + u = 1; + l = 1l; + l = 0xFFFF + 1; + u = 0xFFFF + 1; + ul = 1ul; + l = 1ul; + ll = 0xFFFFFFFF + 1; + ul = 0xFFFFFFFF + 1; + ull = 1lul; + ull = 1; + return 0; +}