[hackers] [scc] Split output and errors in tests || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 11 Jan 2016 11:10:45 +0100 (CET)

commit 50340afa8a166091644dc72230dabff7a132ac11
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Jan 11 11:09:29 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Jan 11 11:09:29 2016 +0100

    Split output and errors in tests
    
    It was a bit ugly to have stderr mixed with stdout.
    This new form allows a better understanding of what
    is the actual output of the program.

diff --git a/cc1/Makefile b/cc1/Makefile
index 02938e6..30b459b 100644
--- a/cc1/Makefile
+++ b/cc1/Makefile
_AT_@ -17,7 +17,7 @@ cpp: cc1
         ln -f cc1 cpp
 
 test:
- cd tests && ./chktest.sh
+ cd tests && ./chktest.sh *.c
 
 clean:
         rm -f $(OBJS)
diff --git a/cc1/tests/chktest.sh b/cc1/tests/chktest.sh
index 5f98e6d..8b838ac 100755
--- a/cc1/tests/chktest.sh
+++ b/cc1/tests/chktest.sh
_AT_@ -1,22 +1,26 @@
 #!/bin/sh
 
 out=/tmp/$$.out
+err=/tmp/$$.err
 chk=/tmp/$$.chk
+tst=/tmp/$$.tst
 
-trap "rm -f $out $chk" EXIT INT QUIT HUP
+trap "rm -f $out $chk $err $tst" EXIT INT QUIT HUP
 rm -f test.log
 
-for i in *.c
+for i
 do
- rm -f $out $chk
- awk '/^name:/ {printf "Running %s ", $2}
- /^output:$/ {copyon=1; next}
- /^\*\// {copyon=0; next}
- copyon==1 {print > "'$chk'"}' $i
+ rm -f $chk
+ awk '/^name:/ {printf "Running %s ", $2}
+ /^error:$/ {copyon=1; next}
+ /^$/ || /^output:$/ {next;}
+ /^\*\// {copyon=0; next}
+ copyon==1 {print > "'$chk'"}' $i
 
- ../cc1 -I. -w $i > $out 2>&1
+ ../cc1 -I. -w $i > $out 2>$err
         echo $i >> test.log
- if diff -c $chk $out >> test.log
+ cat $err $out > $tst
+ if diff -c $chk $tst >> test.log
         then
                 echo [OK]
         else
diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c
index a300c28..d319c5d 100644
--- a/cc1/tests/test001.c
+++ b/cc1/tests/test001.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST001
 description: Basic hello world test
+error:
+
 output:
 F3 I P E
 X4 F3 printf
_AT_@ -11,6 +13,7 @@ G6 F5 main
         X4 "68656C6C6F20776F726C640A 'P pP cI
         r #I0
 }
+
 */
 
 #include <stdio.h>
diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c
index bd2d58c..8b4baba 100644
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST002
 description: Test forward references before definition of types
+error:
+
 output:
 G4 P x
 F7 I
_AT_@ -25,6 +27,7 @@ L14
         b
 L13
 }
+
 */
 
 struct S *x;
diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c
index 7e0170a..ca42597 100644
--- a/cc1/tests/test003.c
+++ b/cc1/tests/test003.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST003
 description: Select function to call inside ternary operator
+error:
+
 output:
 F1 I
 G2 F1 foo
_AT_@ -18,6 +20,7 @@ G4 F1 main
 \
         r G2 cI
 }
+
 */
 
 int
diff --git a/cc1/tests/test004.c b/cc1/tests/test004.c
index 6f9f8db..8289d2a 100644
--- a/cc1/tests/test004.c
+++ b/cc1/tests/test004.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST004
 description: Test integer operations
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -27,6 +29,7 @@ A3 I x
 L4
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test005.c b/cc1/tests/test005.c
index b3af302..b2a5c1e 100644
--- a/cc1/tests/test005.c
+++ b/cc1/tests/test005.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST005
 description: Test unary integer operations
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -17,6 +19,7 @@ A3 I x
 L4
         r #I0
 }
+
 */
 
 
diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c
index b814fc4..bed2274 100644
--- a/cc1/tests/test006.c
+++ b/cc1/tests/test006.c
_AT_@ -1,10 +1,12 @@
 /*
 name: TEST006
 description: Basic test for if
-output:
+error:
 test006.c:6: warning: conditional expression is constant
 test006.c:8: warning: conditional expression is constant
 test006.c:11: warning: conditional expression is constant
+
+output:
 G1 K c
 F2 I E
 G3 F2 main
_AT_@ -32,6 +34,7 @@ L7
 L5
         r #I1
 }
+
 */
 
 char c;
diff --git a/cc1/tests/test007.c b/cc1/tests/test007.c
index bfec6cb..bda27e4 100644
--- a/cc1/tests/test007.c
+++ b/cc1/tests/test007.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST007
 description: basic while test
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -18,6 +20,7 @@ L6
 L5
         r A3
 }
+
 */
 
 int
diff --git a/cc1/tests/test008.c b/cc1/tests/test008.c
index 74dd3b8..87615a4 100644
--- a/cc1/tests/test008.c
+++ b/cc1/tests/test008.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST008
 description: Basic do while loop
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -22,6 +24,7 @@ L6
 L7
         r A3 #I14 -I
 }
+
 */
 
 int
diff --git a/cc1/tests/test009.c b/cc1/tests/test009.c
index 23f2e7b..e11a2d8 100644
--- a/cc1/tests/test009.c
+++ b/cc1/tests/test009.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST009
 description: Basic test for loops
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -21,6 +23,7 @@ L5
 L7
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test010.c b/cc1/tests/test010.c
index d4bd564..1341bb6 100644
--- a/cc1/tests/test010.c
+++ b/cc1/tests/test010.c
_AT_@ -1,10 +1,12 @@
 /*
 name: TEST010
 description: Test for continue and break statements
-output:
+error:
 test010.c:9: warning: conditional expression is constant
 test010.c:11: warning: conditional expression is constant
 test010.c:31: warning: conditional expression is constant
+
+output:
 F1 I E
 G2 F1 main
 {
_AT_@ -57,6 +59,7 @@ L17
 L16
         r A3 #IF -I
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test011.c b/cc1/tests/test011.c
index cd42363..eb04207 100644
--- a/cc1/tests/test011.c
+++ b/cc1/tests/test011.c
_AT_@ -1,9 +1,11 @@
 /*
 name: TEST011
 description: Basic test for goto
-output:
+error:
 test011.c:14: warning: 'foo' defined but not used
 test011.c:14: warning: 'start' defined but not used
+
+output:
 F1 I E
 G2 F1 main
 {
_AT_@ -18,6 +20,7 @@ L6
         j L5
         r #I1
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test012.c b/cc1/tests/test012.c
index 58fb2d6..f846d75 100644
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
_AT_@ -1,8 +1,10 @@
 /*
 name: TEST012
 description: Basic switch test
-output:
+error:
 test012.c:39: warning: 'foo' defined but not used
+
+output:
 F1 I E
 G2 F1 main
 {
_AT_@ -69,6 +71,7 @@ L23
         f L26
 L22
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test013.c b/cc1/tests/test013.c
index 8b0fe48..e6a0dcb 100644
--- a/cc1/tests/test013.c
+++ b/cc1/tests/test013.c
_AT_@ -4,6 +4,8 @@ description: Basic test of integer types and integer conversions
 comments: This test depends of the configuration in the type system.
           With the current configuration char is equal to unsigned char,
           short is equal to int, and unsigned short is equal to unsigned.
+error:
+
 output:
 G1 I a
 G2 N b
_AT_@ -131,6 +133,7 @@ G13 F12 main
         G11 G10 gN :N
         G11 G9 gN :N
 }
+
 */
 
 int a;
diff --git a/cc1/tests/test014.c b/cc1/tests/test014.c
index 2fc66a5..20eeaa5 100644
--- a/cc1/tests/test014.c
+++ b/cc1/tests/test014.c
_AT_@ -1,7 +1,7 @@
 /*
 name: TEST014
 description: Basic storage class test
-output:
+error:
 test014.c:16: warning: 'a' defined but not used
 test014.c:16: warning: 'k' defined but not used
 test014.c:16: warning: 'j' defined but not used
_AT_@ -11,6 +11,15 @@ test014.c:22: warning: 'par' defined but not used
 test014.c:22: warning: 'par' defined but not used
 test014.c:27: warning: 'par' defined but not used
 test014.c:29: error: incorrect storage class for file-scope declaration
+test014.c:29: error: invalid storage class for function 'd'
+test014.c:32: error: bad storage class in function parameter
+test014.c:33: error: invalid storage class for function 'func4'
+test014.c:34: error: invalid type specification
+test014.c:35: warning: 'f' defined but not used
+test014.c:35: warning: 'par' defined but not used
+test014.c:38: error: conflicting types for 'd'
+
+output:
 G1 I a
 Y2 K b
 X3 I c
_AT_@ -37,13 +46,7 @@ T17 F13 func3
 R16 I par
 \
 }
-test014.c:29: error: invalid storage class for function 'd'
-test014.c:32: error: bad storage class in function parameter
-test014.c:33: error: invalid storage class for function 'func4'
-test014.c:34: error: invalid type specification
-test014.c:35: warning: 'f' defined but not used
-test014.c:35: warning: 'par' defined but not used
-test014.c:38: error: conflicting types for 'd'
+
 */
 
 #line 1
diff --git a/cc1/tests/test015.c b/cc1/tests/test015.c
index 8859230..690cff2 100644
--- a/cc1/tests/test015.c
+++ b/cc1/tests/test015.c
_AT_@ -1,8 +1,10 @@
 /*
 name: TEST015
 description: Stress namespace mechanism
+error:
+test015.c:55: error: label 's' already defined
+
 output:
-test015.c:52: error: label 's' already defined
 S8 s2
 M9 I s
 S5 s1
_AT_@ -21,6 +23,7 @@ A17 I s
         r A17
         r A16 M11 .S5 M6 .I A16 M11 .S5 M10 .S8 M9 .I +I
 L15
+
 */
 
 typedef struct s s;
diff --git a/cc1/tests/test016.c b/cc1/tests/test016.c
index b8b9fff..1804a6a 100644
--- a/cc1/tests/test016.c
+++ b/cc1/tests/test016.c
_AT_@ -1,8 +1,11 @@
 /*
 name: TEST016
 description: Basic pointer test
-output:
+error:
 test016.c:43: error: redefinition of 'func2'
+test016.c:47: error: incompatible types when assigning
+
+output:
 G1 I g
 F2 I
 G3 F2 func1
_AT_@ -39,7 +42,7 @@ L14
         A11 #P0 :P
         r A10
 }
-test016.c:47: error: incompatible types when assigning
+
 */
 
 #line 1
diff --git a/cc1/tests/test017.c b/cc1/tests/test017.c
index 0cdd969..47e5747 100644
--- a/cc1/tests/test017.c
+++ b/cc1/tests/test017.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST017
 description: Basic test about pointers and structs
+error:
+
 output:
 F9 I E
 G10 F9 main
_AT_@ -24,6 +26,7 @@ L13
 L14
         r #I0
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test018.c b/cc1/tests/test018.c
index 97152aa..5408f34 100644
--- a/cc1/tests/test018.c
+++ b/cc1/tests/test018.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST018
 description: Basic test for arrays
+error:
+
 output:
 F1 I E
 G2 F1 main
_AT_@ -31,6 +33,7 @@ L15
 L16
         r #I0
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test019.c b/cc1/tests/test019.c
index d3dfee5..920e3df 100644
--- a/cc1/tests/test019.c
+++ b/cc1/tests/test019.c
_AT_@ -2,9 +2,11 @@
 /*
 name: TEST019
 description: Basic test of constant folding in integer arithmetic operations
-output:
+error:
 test019.c:13: warning: division by 0
 test019.c:14: warning: division by 0
+
+output:
 F1 I
 G2 F1 main
 {
_AT_@ -30,6 +32,7 @@ A3 I i
         A3 #I1 :I
         A3 #I0 :I
 }
+
 */
 
 #line 1
diff --git a/cc1/tests/test020.c b/cc1/tests/test020.c
index 885110e..e0e00f3 100644
--- a/cc1/tests/test020.c
+++ b/cc1/tests/test020.c
_AT_@ -2,9 +2,11 @@
 /*
 name: TEST020
 description: Basic test for integer algebraic identities
+error:
+test020.c:84: warning: division by 0
+test020.c:85: warning: division by 0
+
 output:
-test020.c:81: warning: division by 0
-test020.c:82: warning: division by 0
 F1 I
 G2 F1 main
 {
_AT_@ -42,6 +44,7 @@ A3 I i
         A3 A3 #I0 /I :I
         A3 A3 #I0 %I :I
 }
+
 */
 
 int
diff --git a/cc1/tests/test021.c b/cc1/tests/test021.c
index 3630c7f..1a347af 100644
--- a/cc1/tests/test021.c
+++ b/cc1/tests/test021.c
_AT_@ -3,6 +3,8 @@
 name: TEST021
 description: Basic test for char constants
 comments: This test is done for z80 implementation
+error:
+
 output:
 F1 I
 G2 F1 main
_AT_@ -21,6 +23,7 @@ A4 C sc
         A4 #C1 :C
         A4 #C41 :C
 }
+
 */
 
 int
diff --git a/cc1/tests/test022.c b/cc1/tests/test022.c
index a0d629e..76090bc 100644
--- a/cc1/tests/test022.c
+++ b/cc1/tests/test022.c
_AT_@ -3,6 +3,8 @@
 name: TEST022
 description: Basic test for int constants
 comments: This test is done for z80 data types
+error:
+
 output:
 F1 I
 G2 F1 main
_AT_@ -28,6 +30,7 @@ A4 N u
         A4 #N0 :N
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test023.c b/cc1/tests/test023.c
index 0401650..99ad658 100644
--- a/cc1/tests/test023.c
+++ b/cc1/tests/test023.c
_AT_@ -3,6 +3,8 @@
 name: TEST023
 description: Basic test for long constants
 comments: This test is done for z80 data types
+error:
+
 output:
 F1 I
 G2 F1 main
_AT_@ -28,6 +30,7 @@ A4 Z u
         A4 #Z0 :Z
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test024.c b/cc1/tests/test024.c
index 11a2fb4..1f6b857 100644
--- a/cc1/tests/test024.c
+++ b/cc1/tests/test024.c
_AT_@ -3,6 +3,8 @@
 name: TEST024
 description: Basic test for long long constants
 comments: This test is done for z80 data types
+error:
+
 output:
 F1 I
 G2 F1 main
_AT_@ -26,6 +28,7 @@ A4 O u
         A4 #O0 :O
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test025.c b/cc1/tests/test025.c
index c4833a6..b7ad93d 100644
--- a/cc1/tests/test025.c
+++ b/cc1/tests/test025.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST025
 descritpion: Test of ifdef and ifndef
+error:
+
 output:
 G1 I a
 G2 I b
_AT_@ -13,6 +15,7 @@ G7 I e_
 G8 I f_
 G9 I h
 G10 I i
+
 */
 
 #define FOO
diff --git a/cc1/tests/test026.c b/cc1/tests/test026.c
index f1f0ae8..5ce4e8f 100644
--- a/cc1/tests/test026.c
+++ b/cc1/tests/test026.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST026
 descritpion: Test of predefined cpp macros
+error:
+
 output:
 F2 I
 G3 F2 main
_AT_@ -10,12 +12,13 @@ G3 F2 main
 A4 I y
 A6 P p
         A6 "746573743032362E63 'P :P
- A4 #I1E :I
+ A4 #I21 :I
         A4 #I1 :I
         A4 #I1 :I
         A4 #I1 :I
         A4 #I1 :I
 }
+
 */
 
 #define x(y) (y)
diff --git a/cc1/tests/test027.c b/cc1/tests/test027.c
index 9a9d134..5491c49 100644
--- a/cc1/tests/test027.c
+++ b/cc1/tests/test027.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST027
 description: Test of cpp stringizer
+error:
+
 output:
 F2 I
 G3 F2 main
_AT_@ -11,6 +13,7 @@ A5 P p
         A5 "68656C6C6F20697320626574746572207468616E20627965 'P :P
         r A5 _AT_K gI
 }
+
 */
 
 #define x(y) #y
diff --git a/cc1/tests/test028.c b/cc1/tests/test028.c
index f2340dc..e62f305 100644
--- a/cc1/tests/test028.c
+++ b/cc1/tests/test028.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST028
 description: Test of reinterpretation in define
+error:
+
 output:
 F5 P
 G6 F5 foo
_AT_@ -9,6 +11,7 @@ G6 F5 foo
 \
         r "6869 'P
 }
+
 */
 
 
diff --git a/cc1/tests/test029.c b/cc1/tests/test029.c
index 4ef6955..4da3700 100644
--- a/cc1/tests/test029.c
+++ b/cc1/tests/test029.c
_AT_@ -5,8 +5,11 @@ description: Test of nested expansion and refusing macro without arguments
 comments: f(2) will expand to 2*g, which will expand to 2*f, and in this
           moment f will not be expanded because the macro definition is
           a function alike macro, and in this case there is no arguments.
+error:
+test029.c:37: error: redefinition of 'f1'
+test029.c:38: error: 'f' undeclared
+
 output:
-test029.c:34: error: redefinition of 'f1'
 F2 I
 G3 F2 f1
 {
_AT_@ -14,7 +17,7 @@ G3 F2 f1
 A4 I f
         A4 #I2 *I
 }
-test029.c:35: error: 'f' undeclared
+
 */
 
 
diff --git a/cc1/tests/test030.c b/cc1/tests/test030.c
index cde5243..c8afdf2 100644
--- a/cc1/tests/test030.c
+++ b/cc1/tests/test030.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST030
 description: Basic test for vararg functions
+error:
+
 output:
 F13 I S2 P I E
 G14 F13 f1
_AT_@ -31,6 +33,7 @@ A18 S2 f
         G14 A18 pS2 A18 'P pP #I2 pI #I1 pI A18 pS2 A18 'P pP cI
         r #I0
 }
+
 */
 
 struct foo {
diff --git a/cc1/tests/test031.c b/cc1/tests/test031.c
index b358d8d..5935fb2 100644
--- a/cc1/tests/test031.c
+++ b/cc1/tests/test031.c
_AT_@ -2,18 +2,10 @@
 /*
 name: TEST031
 description: Test concatenation in preprocessor
+error:
+
 output:
-F5 I
-G6 F5 main
-{
-\
-A7 I foo
-A8 I bar
-A9 I foobar
- A9 A7 A8 +I :I
- A9 A7 A8 +I :I
- r #I0
-}
+
 */
 
 #define CAT(x,y) x ## y
diff --git a/cc1/tests/test032.c b/cc1/tests/test032.c
index c94f6b5..0db8263 100644
--- a/cc1/tests/test032.c
+++ b/cc1/tests/test032.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST032
 description: test special characters _AT_ and $ in macro definitions
+error:
+
 output:
 F3 I
 G4 F3 main
_AT_@ -11,6 +13,7 @@ A6 P p
         A6 "54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021 'P :P
         r A6 #P0 !I
 }
+
 */
 
 #define M1(x) "This is a string $ or # or ##" ## #x
diff --git a/cc1/tests/test033.c b/cc1/tests/test033.c
index e9176af..163ec33 100644
--- a/cc1/tests/test033.c
+++ b/cc1/tests/test033.c
_AT_@ -1,8 +1,11 @@
 /*
 name: TEST033
 description: test for #if defined()
+error:
+
 output:
 G1 I c
+
 */
 
 #if defined(FOO)
diff --git a/cc1/tests/test034.c b/cc1/tests/test034.c
index 0cb2cd8..80fb5ca 100644
--- a/cc1/tests/test034.c
+++ b/cc1/tests/test034.c
_AT_@ -2,8 +2,11 @@
 /*
 name: TEST034
 description: Basic test for incomplete structures
+error:
+test034.c:48: error: declared variable 'bar' of incomplete type
+test034.c:48: error: redeclaration of 'bar'
+
 output:
-test034.c:45: error: declared variable 'bar' of incomplete type
 X3 S2 x
 F4 I E
 X5 F4 foo
_AT_@ -20,7 +23,7 @@ G5 F4 foo
         r X3 M9 .I
 }
 X13 S11 bar2
-test034.c:45: error: redeclaration of 'bar'
+
 */
 
 extern struct X x;
diff --git a/cc1/tests/test035.c b/cc1/tests/test035.c
index e5daedc..5d987cd 100644
--- a/cc1/tests/test035.c
+++ b/cc1/tests/test035.c
_AT_@ -2,6 +2,8 @@
 /*
 name: TEST035
 description: Basic test for enumerations
+error:
+
 output:
 F6 I E
 G7 F6 main
_AT_@ -23,6 +25,7 @@ L11
 L12
         r #I0
 }
+
 */
 
 enum E {
diff --git a/cc1/tests/test036.c b/cc1/tests/test036.c
index 11da8d7..bc32b69 100644
--- a/cc1/tests/test036.c
+++ b/cc1/tests/test036.c
_AT_@ -2,8 +2,10 @@
 /*
 name: TEST036
 description: Duff's device
+error:
+test036.c:63: warning: type defaults to 'int' in declaration
+
 output:
-test036.c:60: warning: type defaults to 'int' in declaration
 F4 I E
 G5 F4 send
 {
_AT_@ -48,6 +50,7 @@ L9
         v L10 #I0
 L8
 }
+
 */
 
 /* Disgusting, no? But it compiles and runs just fine. I feel a combination of
diff --git a/cc1/tests/test037.c b/cc1/tests/test037.c
index c50ca3d..ed6c0e6 100644
--- a/cc1/tests/test037.c
+++ b/cc1/tests/test037.c
_AT_@ -3,10 +3,12 @@
 name: TEST037
 description: Basic sizeof test
 comments: This test is based in z80 sizes
+error:
+test037.c:32: warning: conditional expression is constant
+test037.c:34: warning: conditional expression is constant
+test037.c:36: warning: conditional expression is constant
+
 output:
-test037.c:29: warning: conditional expression is constant
-test037.c:31: warning: conditional expression is constant
-test037.c:33: warning: conditional expression is constant
 F1 I E
 G2 F1 main
 {
_AT_@ -22,6 +24,7 @@ L4
 L5
         r #I0
 }
+
 */
 
 int main()
diff --git a/cc1/tests/test038.c b/cc1/tests/test038.c
index 4e1a221..f8554d0 100644
--- a/cc1/tests/test038.c
+++ b/cc1/tests/test038.c
_AT_@ -2,8 +2,10 @@
 /*
 name: TEST038
 description: Basic test for tentative definitions
+error:
+test038.c:48: error: redeclaration of 'x'
+
 output:
-test038.c:45: error: redeclaration of 'x'
 G1 I x
 (
         #I0
_AT_@ -22,6 +24,7 @@ G3 F2 main
         G1 #I0 :I
         r G1
 }
+
 */
 
 int x;
diff --git a/cc1/tests/test039.c b/cc1/tests/test039.c
index aee481f..da5575b 100644
--- a/cc1/tests/test039.c
+++ b/cc1/tests/test039.c
_AT_@ -3,6 +3,8 @@
 name: TEST039
 description: Test of integer constants
 comments: This test is done for z80 sizes
+error:
+
 output:
 F1 I
 G2 F1 main
_AT_@ -29,6 +31,7 @@ A8 O ull
         A8 #O1 :O
         r #I0
 }
+
 */
 
 int
diff --git a/cc1/tests/test040.c b/cc1/tests/test040.c
index 6552a58..3ece5df 100644
--- a/cc1/tests/test040.c
+++ b/cc1/tests/test040.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST040
 description: Test for bug parsing typenames in struct definition
+error:
+
 output:
 F8 I
 G9 F8 main
_AT_@ -13,6 +15,7 @@ M7 P back
 A10 S2 List
         r A10 M4 .I
 }
+
 */
 
 typedef struct List List;
diff --git a/cc1/tests/test041.c b/cc1/tests/test041.c
index cd618e0..f47784a 100644
--- a/cc1/tests/test041.c
+++ b/cc1/tests/test041.c
_AT_@ -1,8 +1,15 @@
 /*
 name: TEST041
 description: Test for bug parsing ternary operators
+error:
+test041.c:51: error: type mismatch in conditional expression
+test041.c:51: error: incompatible types when assigning
+test041.c:52: error: used struct/union type value where scalar is required
+test041.c:53: warning: 'i' defined but not used
+test041.c:53: warning: 'foo' defined but not used
+test041.c:53: warning: 's' defined but not used
+
 output:
-test041.c:48: error: type mismatch in conditional expression
 F1 I
 G2 F1 main
 {
_AT_@ -22,11 +29,7 @@ A12 S10 foo
         A5 A3 #I0 !I A8 #P0 ?P :P
         A5 A3 #I0 !I A5 #P0 ?P :P
         A5 A3 #I0 !I #P0 A5 ?P :P
-test041.c:48: error: incompatible types when assigning
-test041.c:49: error: used struct/union type value where scalar is required
-test041.c:50: warning: 'i' defined but not used
-test041.c:50: warning: 'foo' defined but not used
-test041.c:50: warning: 's' defined but not used
+
 */
    
 int
diff --git a/cc1/tests/test042.c b/cc1/tests/test042.c
index f711a9e..a725d2c 100644
--- a/cc1/tests/test042.c
+++ b/cc1/tests/test042.c
_AT_@ -1,14 +1,17 @@
 /*
 name: TEST042
 description: Test for bug parsing ternary operators
+error:
+test042.c:22: error: bad type convertion requested
+
 output:
-test042.c:19: error: bad type convertion requested
 F1 I
 G2 F1 main
 {
 \
 F3 0
 X4 F3 f
+
 */
 
 int
diff --git a/cc1/tests/test043.c b/cc1/tests/test043.c
index d4fd1de..770b91a 100644
--- a/cc1/tests/test043.c
+++ b/cc1/tests/test043.c
_AT_@ -1,6 +1,8 @@
 /*
 name: TEST043
 description: Test for double typedef (taken from plan9 kernel)
+error:
+
 output:
 F4 0
 S2 Clock0link
_AT_@ -14,6 +16,7 @@ G11 F10 main
         G9 M6 .P _AT_F4 c0
         r #I0
 }
+
 */
 
 typedef struct Clock0link Clock0link;
diff --git a/cc1/tests/test044.c b/cc1/tests/test044.c
index dc65d59..69d29ef 100644
--- a/cc1/tests/test044.c
+++ b/cc1/tests/test044.c
_AT_@ -1,12 +1,15 @@
 /*
 name: TEST044
 description: Test of corner cases in #if
+error:
+test044.c:17: warning: division by 0
+test044.c:21: warning: division by 0
+test044.c:25: warning: division by 0
+test044.c:31: error: parameter of #if is not an integer constant expression
+test044.c:32: error: #error 3 != (1,2,3)
+
 output:
-test044.c:14: warning: division by 0
-test044.c:18: warning: division by 0
-test044.c:22: warning: division by 0
-test044.c:28: error: parameter of #if is not an integer constant expression
-test044.c:29: error: #error 3 != (1,2,3)
+
 */
 
 /* These should be accepted */
diff --git a/cc1/tests/update.sh b/cc1/tests/update.sh
index 36fe2e3..f71f701 100755
--- a/cc1/tests/update.sh
+++ b/cc1/tests/update.sh
_AT_@ -1,5 +1,10 @@
 #!/bin/sh
 
+out=/tmp/$$.out
+err=/tmp/$$.err
+
+trap "rm -f $out $err" EXIT INT QUIT HUP
+
 case $# in
 0)
         echo "usage: update.sh test ..." >&2
_AT_@ -8,9 +13,13 @@ case $# in
 *)
         for i
         do
- (echo '/^output/+;/^\*\//-c'
- ../cc1 -I./ -w $1 2>&1
- printf ".\nw\n") | ed -s $1
+ ../cc1 -I./ -w $i >$out 2>$err
+ (echo '/^error/+;/^output/-c'
+ cat $err
+ printf "\n.\n"
+ echo '/^output/+;/^\*\//-c'
+ cat $out
+ printf "\n.\nw\n") | ed -s $i
         done
         ;;
 esac
Received on Mon Jan 11 2016 - 11:10:45 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 11 2016 - 11:12:13 CET