[hackers] [scc] Add test for integer constants || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 7 Oct 2015 17:44:48 +0200 (CEST)

commit 6b08a16dbf2e47ec630fd0f1dd575e82a5feb182
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Oct 7 17:29:52 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Oct 7 17:29:52 2015 +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.

diff --git a/cc1/tests/test039.c b/cc1/tests/test039.c
new file mode 100644
index 0000000..aee481f
--- /dev/null
+++ b/cc1/tests/test039.c
_AT_@ -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;
+}
Received on Wed Oct 07 2015 - 17:44:48 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 07 2015 - 17:48:27 CEST