ref: 4647857edbfea51d3d55f8a6d938d7430a86c71f
parent: 344fd675a32ccd273bc4e4ffccd938ebeefa941c
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Jan 20 12:40:41 EST 2016
Remove added blank lines This lines were added because update.sh added an additional newline to ensure that . was at the beginning of the line. It is not needed because every line line will contain it (or you should change of editor) This change makes that test010 is ok now.
--- a/cc1/tests/chktest.sh
+++ b/cc1/tests/chktest.sh
@@ -13,7 +13,7 @@
rm -f $chk
awk '/^name:/ {printf "Running %s ", $2}
/^error:$/ {copyon=1; next}
- /^$/ || /^output:$/ {next;}
+ /^output:$/ {next}
/^\*\// {copyon=0; next}
copyon==1 {print > "'$chk'"}' $i
--- a/cc1/tests/test001.c
+++ b/cc1/tests/test001.c
@@ -2,7 +2,6 @@
name: TEST001
description: Basic hello world test
error:
-
output:
F3 I P E
X4 F3 printf
@@ -13,7 +12,6 @@
X4 "68656C6C6F20776F726C640A00 'P pP cI
r #I0
}
-
*/
#include <stdio.h>
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
@@ -2,7 +2,6 @@
name: TEST002
description: Test forward references before definition of types
error:
-
output:
G4 P x
F7 I
@@ -27,7 +26,6 @@
b
L13
}
-
*/
struct S *x;
--- a/cc1/tests/test003.c
+++ b/cc1/tests/test003.c
@@ -2,7 +2,6 @@
name: TEST003
description: Select function to call inside ternary operator
error:
-
output:
F1 I
G2 F1 foo
@@ -20,7 +19,6 @@
\
r G2 cI
}
-
*/
int
--- a/cc1/tests/test004.c
+++ b/cc1/tests/test004.c
@@ -2,7 +2,6 @@
name: TEST004
description: Test integer operations
error:
-
output:
F1 I E
G2 F1 main
@@ -29,7 +28,6 @@
L4
r #I0
}
-
*/
int
--- a/cc1/tests/test005.c
+++ b/cc1/tests/test005.c
@@ -2,7 +2,6 @@
name: TEST005
description: Test unary integer operations
error:
-
output:
F1 I E
G2 F1 main
@@ -19,7 +18,6 @@
L4
r #I0
}
-
*/
--- a/cc1/tests/test006.c
+++ b/cc1/tests/test006.c
@@ -5,7 +5,6 @@
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
@@ -34,7 +33,6 @@
L5
r #I1
}
-
*/
char c;
--- a/cc1/tests/test007.c
+++ b/cc1/tests/test007.c
@@ -2,7 +2,6 @@
name: TEST007
description: basic while test
error:
-
output:
F1 I E
G2 F1 main
@@ -20,7 +19,6 @@
L5
r A3
}
-
*/
int
--- a/cc1/tests/test008.c
+++ b/cc1/tests/test008.c
@@ -2,7 +2,6 @@
name: TEST008
description: Basic do while loop
error:
-
output:
F1 I E
G2 F1 main
@@ -24,7 +23,6 @@
L7
r A3 #I14 -I
}
-
*/
int
--- a/cc1/tests/test009.c
+++ b/cc1/tests/test009.c
@@ -2,7 +2,6 @@
name: TEST009
description: Basic test for loops
error:
-
output:
F1 I E
G2 F1 main
@@ -23,7 +22,6 @@
L7
r #I0
}
-
*/
int
--- a/cc1/tests/test010.c
+++ b/cc1/tests/test010.c
@@ -5,7 +5,6 @@
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
@@ -59,7 +58,6 @@
L16
r A3 #IF -I
}
-
*/
#line 1
--- a/cc1/tests/test011.c
+++ b/cc1/tests/test011.c
@@ -4,7 +4,6 @@
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
@@ -20,7 +19,6 @@
j L5
r #I1
}
-
*/
#line 1
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
@@ -3,7 +3,6 @@
description: Basic switch test
error:
test012.c:39: warning: 'foo' defined but not used
-
output:
F1 I E
G2 F1 main
@@ -71,7 +70,6 @@
f L26
L22
}
-
*/
#line 1
--- a/cc1/tests/test013.c
+++ b/cc1/tests/test013.c
@@ -5,7 +5,6 @@
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
@@ -133,7 +132,6 @@
G11 G10 gN :N
G11 G9 gN :N
}
-
*/
int a;
--- a/cc1/tests/test014.c
+++ b/cc1/tests/test014.c
@@ -18,7 +18,6 @@
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
@@ -46,7 +45,6 @@
R16 I par
\
}
-
*/
#line 1
--- a/cc1/tests/test015.c
+++ b/cc1/tests/test015.c
@@ -2,8 +2,7 @@
name: TEST015
description: Stress namespace mechanism
error:
-test015.c:55: error: label 's' already defined
-
+test015.c:53: error: label 's' already defined
output:
S8 s2
M9 I s
@@ -23,7 +22,6 @@
r A17
r A16 M11 .S5 M6 .I A16 M11 .S5 M10 .S8 M9 .I +I
L15
-
*/
typedef struct s s;
--- a/cc1/tests/test016.c
+++ b/cc1/tests/test016.c
@@ -4,7 +4,6 @@
error:
test016.c:43: error: redefinition of 'func2'
test016.c:47: error: incompatible types when assigning
-
output:
G1 I g
F2 I
@@ -42,7 +41,6 @@
A11 #P0 :P
r A10
}
-
*/
#line 1
--- a/cc1/tests/test017.c
+++ b/cc1/tests/test017.c
@@ -2,7 +2,6 @@
name: TEST017
description: Basic test about pointers and structs
error:
-
output:
F9 I E
G10 F9 main
@@ -26,7 +25,6 @@
L14
r #I0
}
-
*/
#line 1
--- a/cc1/tests/test018.c
+++ b/cc1/tests/test018.c
@@ -2,7 +2,6 @@
name: TEST018
description: Basic test for arrays
error:
-
output:
F1 I E
G2 F1 main
@@ -33,7 +32,6 @@
L16
r #I0
}
-
*/
#line 1
--- a/cc1/tests/test019.c
+++ b/cc1/tests/test019.c
@@ -5,7 +5,6 @@
error:
test019.c:13: warning: division by 0
test019.c:14: warning: division by 0
-
output:
F1 I
G2 F1 main
@@ -32,7 +31,6 @@
A3 #I1 :I
A3 #I0 :I
}
-
*/
#line 1
--- a/cc1/tests/test020.c
+++ b/cc1/tests/test020.c
@@ -3,9 +3,8 @@
name: TEST020
description: Basic test for integer algebraic identities
error:
-test020.c:84: warning: division by 0
-test020.c:85: warning: division by 0
-
+test020.c:82: warning: division by 0
+test020.c:83: warning: division by 0
output:
F1 I
G2 F1 main
@@ -44,7 +43,6 @@
A3 A3 #I0 /I :I
A3 A3 #I0 %I :I
}
-
*/
int
--- a/cc1/tests/test021.c
+++ b/cc1/tests/test021.c
@@ -4,7 +4,6 @@
description: Basic test for char constants
comments: This test is done for z80 implementation
error:
-
output:
F1 I
G2 F1 main
@@ -23,7 +22,6 @@
A4 #C1 :C
A4 #C41 :C
}
-
*/
int
--- a/cc1/tests/test022.c
+++ b/cc1/tests/test022.c
@@ -4,7 +4,6 @@
description: Basic test for int constants
comments: This test is done for z80 data types
error:
-
output:
F1 I
G2 F1 main
@@ -30,7 +29,6 @@
A4 #N0 :N
r #I0
}
-
*/
int
--- a/cc1/tests/test023.c
+++ b/cc1/tests/test023.c
@@ -4,7 +4,6 @@
description: Basic test for long constants
comments: This test is done for z80 data types
error:
-
output:
F1 I
G2 F1 main
@@ -30,7 +29,6 @@
A4 #Z0 :Z
r #I0
}
-
*/
int
--- a/cc1/tests/test024.c
+++ b/cc1/tests/test024.c
@@ -4,7 +4,6 @@
description: Basic test for long long constants
comments: This test is done for z80 data types
error:
-
output:
F1 I
G2 F1 main
@@ -28,7 +27,6 @@
A4 #O0 :O
r #I0
}
-
*/
int
--- a/cc1/tests/test025.c
+++ b/cc1/tests/test025.c
@@ -3,7 +3,6 @@
name: TEST025
descritpion: Test of ifdef and ifndef
error:
-
output:
G1 I a
G2 I b
@@ -15,7 +14,6 @@
G8 I f_
G9 I h
G10 I i
-
*/
#define FOO
--- a/cc1/tests/test026.c
+++ b/cc1/tests/test026.c
@@ -3,7 +3,6 @@
name: TEST026
descritpion: Test of predefined cpp macros
error:
-
output:
F2 I
G3 F2 main
@@ -12,13 +11,12 @@
A4 I y
A6 P p
A6 "746573743032362E6300 'P :P
- A4 #I21 :I
+ A4 #I1F :I
A4 #I1 :I
A4 #I1 :I
A4 #I1 :I
A4 #I1 :I
}
-
*/
#define x(y) (y)
--- a/cc1/tests/test027.c
+++ b/cc1/tests/test027.c
@@ -3,7 +3,6 @@
name: TEST027
description: Test of cpp stringizer
error:
-
output:
F2 I
G3 F2 main
@@ -13,7 +12,6 @@
A5 "68656C6C6F20697320626574746572207468616E2062796500 'P :P
r A5 @K gI
}
-
*/
#define x(y) #y
--- a/cc1/tests/test028.c
+++ b/cc1/tests/test028.c
@@ -3,7 +3,6 @@
name: TEST028
description: Test of reinterpretation in define
error:
-
output:
F5 P
G6 F5 foo
@@ -11,7 +10,6 @@
\
r "686900 'P
}
-
*/
--- a/cc1/tests/test029.c
+++ b/cc1/tests/test029.c
@@ -6,9 +6,8 @@
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
-
+test029.c:35: error: redefinition of 'f1'
+test029.c:36: error: 'f' undeclared
output:
F2 I
G3 F2 f1
@@ -17,7 +16,6 @@
A4 I f
A4 #I2 *I
}
-
*/
--- a/cc1/tests/test030.c
+++ b/cc1/tests/test030.c
@@ -3,7 +3,6 @@
name: TEST030
description: Basic test for vararg functions
error:
-
output:
F13 I S2 P I E
G14 F13 f1
@@ -33,7 +32,6 @@
G14 A18 pS2 A18 'P pP #I2 pI #I1 pI A18 pS2 A18 'P pP cI
r #I0
}
-
*/
struct foo {
--- a/cc1/tests/test031.c
+++ b/cc1/tests/test031.c
@@ -3,7 +3,7 @@
name: TEST031
description: Test concatenation in preprocessor
error:
-
+TODO
output:
*/
--- a/cc1/tests/test032.c
+++ b/cc1/tests/test032.c
@@ -3,7 +3,6 @@
name: TEST032
description: test special characters @ and $ in macro definitions
error:
-
output:
F3 I
G4 F3 main
@@ -13,7 +12,6 @@
A6 "54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B202100 'P :P
r A6 #P0 !I
}
-
*/
#define M1(x) "This is a string $ or # or ##" ## #x
--- a/cc1/tests/test033.c
+++ b/cc1/tests/test033.c
@@ -2,10 +2,8 @@
name: TEST033
description: test for #if defined()
error:
-
output:
G1 I c
-
*/
#if defined(FOO)
--- a/cc1/tests/test034.c
+++ b/cc1/tests/test034.c
@@ -3,9 +3,8 @@
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'
-
+test034.c:46: error: declared variable 'bar' of incomplete type
+test034.c:46: error: redeclaration of 'bar'
output:
X3 S2 x
F4 I E
@@ -23,7 +22,6 @@
r X3 M9 .I
}
X13 S11 bar2
-
*/
extern struct X x;
--- a/cc1/tests/test035.c
+++ b/cc1/tests/test035.c
@@ -3,7 +3,6 @@
name: TEST035
description: Basic test for enumerations
error:
-
output:
F6 I E
G7 F6 main
@@ -25,7 +24,6 @@
L12
r #I0
}
-
*/
enum E {
--- a/cc1/tests/test036.c
+++ b/cc1/tests/test036.c
@@ -3,8 +3,7 @@
name: TEST036
description: Duff's device
error:
-test036.c:63: warning: type defaults to 'int' in declaration
-
+test036.c:61: warning: type defaults to 'int' in declaration
output:
F4 I E
G5 F4 send
@@ -50,7 +49,6 @@
v L10 #I0
L8
}
-
*/
/* Disgusting, no? But it compiles and runs just fine. I feel a combination of
--- a/cc1/tests/test037.c
+++ b/cc1/tests/test037.c
@@ -4,10 +4,9 @@
description: Basic sizeof test
comments: This test is based in z80 sizes
error:
+test037.c:30: warning: conditional expression is constant
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:
F1 I E
G2 F1 main
@@ -24,7 +23,6 @@
L5
r #I0
}
-
*/
int main()
--- a/cc1/tests/test038.c
+++ b/cc1/tests/test038.c
@@ -3,8 +3,7 @@
name: TEST038
description: Basic test for tentative definitions
error:
-test038.c:48: error: redeclaration of 'x'
-
+test038.c:46: error: redeclaration of 'x'
output:
G1 I x
(
@@ -24,7 +23,6 @@
G1 #I0 :I
r G1
}
-
*/
int x;
--- a/cc1/tests/test039.c
+++ b/cc1/tests/test039.c
@@ -4,7 +4,6 @@
description: Test of integer constants
comments: This test is done for z80 sizes
error:
-
output:
F1 I
G2 F1 main
@@ -31,7 +30,6 @@
A8 #O1 :O
r #I0
}
-
*/
int
--- a/cc1/tests/test040.c
+++ b/cc1/tests/test040.c
@@ -2,7 +2,6 @@
name: TEST040
description: Test for bug parsing typenames in struct definition
error:
-
output:
F8 I
G9 F8 main
@@ -15,7 +14,6 @@
A10 S2 List
r A10 M4 .I
}
-
*/
typedef struct List List;
--- a/cc1/tests/test041.c
+++ b/cc1/tests/test041.c
@@ -2,13 +2,12 @@
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
-
+test041.c:49: error: type mismatch in conditional expression
+test041.c:49: error: incompatible types when assigning
+test041.c:50: error: used struct/union type value where scalar is required
+test041.c:51: warning: 'i' defined but not used
+test041.c:51: warning: 'foo' defined but not used
+test041.c:51: warning: 's' defined but not used
output:
F1 I
G2 F1 main
@@ -29,7 +28,6 @@
A5 A3 #I0 !I A8 #P0 ?P :P
A5 A3 #I0 !I A5 #P0 ?P :P
A5 A3 #I0 !I #P0 A5 ?P :P
-
*/
int
--- a/cc1/tests/test042.c
+++ b/cc1/tests/test042.c
@@ -2,8 +2,7 @@
name: TEST042
description: Test for bug parsing ternary operators
error:
-test042.c:22: error: bad type convertion requested
-
+test042.c:20: error: bad type convertion requested
output:
F1 I
G2 F1 main
@@ -11,7 +10,6 @@
\
F3 0
X4 F3 f
-
*/
int
--- a/cc1/tests/test043.c
+++ b/cc1/tests/test043.c
@@ -2,7 +2,6 @@
name: TEST043
description: Test for double typedef (taken from plan9 kernel)
error:
-
output:
F4 0
S2 Clock0link
@@ -16,7 +15,6 @@
G9 M6 .P @F4 c0
r #I0
}
-
*/
typedef struct Clock0link Clock0link;
--- a/cc1/tests/test044.c
+++ b/cc1/tests/test044.c
@@ -2,14 +2,12 @@
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)
-
+test044.c:15: warning: division by 0
+test044.c:19: warning: division by 0
+test044.c:23: warning: division by 0
+test044.c:29: error: parameter of #if is not an integer constant expression
+test044.c:30: error: #error 3 != (1,2,3)
output:
-
*/
/* These should be accepted */
--- a/cc1/tests/test045.c
+++ b/cc1/tests/test045.c
@@ -2,7 +2,6 @@
name: TEST045
description: Basic test of initializers
error:
-
output:
G1 I x
(
@@ -17,7 +16,6 @@
L4
r #I0
}
-
*/
--- a/cc1/tests/test046.c
+++ b/cc1/tests/test046.c
@@ -2,7 +2,6 @@
name: TEST046
description: Basic test for initializators
error:
-
output:
V1 I #3
G2 V1 x
@@ -26,7 +25,6 @@
L8
r #I0
}
-
*/
int x[3] = {1, 2, 3};
--- a/cc1/tests/test047.c
+++ b/cc1/tests/test047.c
@@ -2,7 +2,6 @@
name: TEST047
description: Basic test for initializer
error:
-
output:
S2 S
M3 I a
@@ -29,7 +28,6 @@
L11
r #I0
}
-
*/
--- a/cc1/tests/test048.c
+++ b/cc1/tests/test048.c
@@ -2,7 +2,6 @@
name: TEST048
description: Basic test for initializer
error:
-
output:
S2 S
M3 I a
@@ -25,7 +24,6 @@
L11
r #I0
}
-
*/
struct S {
--- a/cc1/tests/test049.c
+++ b/cc1/tests/test049.c
@@ -2,7 +2,6 @@
name: TEST049
description: Basic test for initializer
error:
-
output:
G1 I x
(
@@ -21,7 +20,6 @@
L6
r #I0
}
-
*/
int x = 5;
--- a/cc1/tests/test050.c
+++ b/cc1/tests/test050.c
@@ -2,9 +2,8 @@
name: TEST050
description: Basic test for initializer
error:
-TODO
+TODO:
output:
-
*/
struct S { int a; int b; };
--- a/cc1/tests/test051.c
+++ b/cc1/tests/test051.c
@@ -2,7 +2,6 @@
name: TEST051
description: Basic test for initializer
error:
-
output:
V1 I #3
G2 V1 arr
@@ -26,7 +25,6 @@
L8
r #I0
}
-
*/
int arr[3] = {[2] = 2, [0] = 0, [1] = 1};
--- a/cc1/tests/test052.c
+++ b/cc1/tests/test052.c
@@ -2,7 +2,6 @@
name: TEST052
description: Basic test for initializer
error:
-
output:
S2 S
M3 I a
@@ -33,7 +32,6 @@
L13
r #I0
}
-
*/
struct S {int a; int b;};
--- a/cc1/tests/test053.c
+++ b/cc1/tests/test053.c
@@ -2,7 +2,6 @@
name: TEST053
description: Basic test for initializer
error:
-
output:
S2 S
M3 I a
@@ -24,7 +23,6 @@
L9
r #I0
}
-
*/
struct S {int a; int b;};
--- a/cc1/tests/test056.c
+++ b/cc1/tests/test056.c
@@ -2,7 +2,6 @@
name: TEST056
desciption: Test of overlaying designators
error:
-
output:
V6 K #3
S2 S
@@ -30,7 +29,6 @@
A13 :V12
r G9 M7 .V6 'P #P2 +P @K gI gN #N0 !I
}
-
*/
struct S {
--- a/cc1/tests/test057.c
+++ b/cc1/tests/test057.c
@@ -3,7 +3,6 @@
name: TEST057
description: test of initialization of incomplete arrays
error:
-
output:
V1 I #3
V2 V1 #2
@@ -31,7 +30,6 @@
\
r G3 'P #P6 +P #P4 +P @I G4 'P #P6 +P #P6 +P @I !I
}
-
*/
int arr1[][3] = {
--- a/cc1/tests/test058.c
+++ b/cc1/tests/test058.c
@@ -2,7 +2,6 @@
name: TEST058
description: Test of initialization mixing dsignators and sequence
error:
-
output:
V1 I #5
V2 V1 #3
@@ -46,7 +45,6 @@
\
r G4 'P #PA +P #P8 +P @I G4 'P #P1E +P #PA +P #P8 +P @I !I
}
-
*/
int arr[][3][5] = {
--- a/cc1/tests/test059.c
+++ b/cc1/tests/test059.c
@@ -2,9 +2,8 @@
name: TEST059
description: Test of initalizers for strings
error:
-test059.c:33: warning: initializer-string for array of chars is too long
-test059.c:35: error: array of inappropriate type initialized from string constant
-
+test059.c:31: warning: initializer-string for array of chars is too long
+test059.c:33: error: array of inappropriate type initialized from string constant
output:
V1 K #4
G2 V1 s0
@@ -25,7 +24,6 @@
(
"666F6F00 'P
)
-
*/
char s0[] = "foo";
--- a/cc1/tests/update.sh
+++ b/cc1/tests/update.sh
@@ -16,10 +16,10 @@
../cc1 -I./ -w $i >$out 2>$err
(echo '/^error/+;/^output/-c'
cat $err
- printf "\n.\n"
+ printf ".\n"
echo '/^output/+;/^\*\//-c'
cat $out
- printf "\n.\nw\n") | ed -s $i
+ printf ".\nw\n") | ed -s $i
done
;;
esac