scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 131f1d80c5f93ba7704f3bacdc353636663a645e
parent 12d32d40a8be1d7c133aa5d6ab0032efc1a42345
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 14 Dec 2016 14:13:11 +0100

[cc1] Do not create types in CPPMODE

Strings in macros were generating types, and it created problems
in onlycpp mode, because these types were emitted even when
we were in onlycpp mode, mode supposed to don't print any
IR.

Diffstat:
Mcc1/symbol.c | 8++++++--
Mcc1/tests/test001.c | 12+++++-------
Mcc1/tests/test002.c | 36+++++++++++++++++-------------------
Mcc1/tests/test003.c | 10++++------
Mcc1/tests/test004.c | 40+++++++++++++++++++---------------------
Mcc1/tests/test005.c | 20+++++++++-----------
Mcc1/tests/test006.c | 36+++++++++++++++++-------------------
Mcc1/tests/test007.c | 22++++++++++------------
Mcc1/tests/test008.c | 26++++++++++++--------------
Mcc1/tests/test009.c | 24+++++++++++-------------
Mcc1/tests/test010.c | 60+++++++++++++++++++++++++++++-------------------------------
Mcc1/tests/test011.c | 16+++++++---------
Mcc1/tests/test012.c | 78++++++++++++++++++++++++++++++++++++++----------------------------------------
Mcc1/tests/test013.c | 246+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mcc1/tests/test014.c | 30++++++++++++++----------------
Mcc1/tests/test015.c | 34++++++++++++++++------------------
Mcc1/tests/test016.c | 54++++++++++++++++++++++++++----------------------------
Mcc1/tests/test017.c | 32+++++++++++++++-----------------
Mcc1/tests/test018.c | 42++++++++++++++++++++----------------------
Mcc1/tests/test019.c | 44+++++++++++++++++++++-----------------------
Mcc1/tests/test020.c | 72+++++++++++++++++++++++++++++++++++-------------------------------------
Mcc1/tests/test021.c | 28+++++++++++++---------------
Mcc1/tests/test022.c | 40+++++++++++++++++++---------------------
Mcc1/tests/test023.c | 40+++++++++++++++++++---------------------
Mcc1/tests/test024.c | 36+++++++++++++++++-------------------
Mcc1/tests/test025.c | 22++++++++++------------
Mcc1/tests/test026.c | 24+++++++++++-------------
Mcc1/tests/test027.c | 14++++++--------
Mcc1/tests/test028.c | 10++++------
Mcc1/tests/test029.c | 16+++++++---------
Mcc1/tests/test030.c | 38++++++++++++++++++--------------------
Mcc1/tests/test032.c | 15++++++---------
Mcc1/tests/test033.c | 4+---
Mcc1/tests/test034.c | 28+++++++++++++---------------
Mcc1/tests/test035.c | 21+++++++++++++++++++--
Mcc1/tests/test036.c | 68+++++++++++++++++++++++++++++++++-----------------------------------
Mcc1/tests/test037.c | 18++++++++----------
Mcc1/tests/test038.c | 20+++++++++-----------
Mcc1/tests/test039.c | 42++++++++++++++++++++----------------------
Mcc1/tests/test040.c | 16+++++++---------
Mcc1/tests/test041.c | 48+++++++++++++++++++++++-------------------------
Mcc1/tests/test042.c | 8+++-----
Mcc1/tests/test043.c | 14++++++--------
Mcc1/tests/test045.c | 10++++------
Mcc1/tests/test046.c | 20+++++++++-----------
Mcc1/tests/test047.c | 26++++++++++++--------------
Mcc1/tests/test048.c | 22++++++++++------------
Mcc1/tests/test049.c | 14++++++--------
Mcc1/tests/test051.c | 20+++++++++-----------
Mcc1/tests/test052.c | 30++++++++++++++----------------
Mcc1/tests/test053.c | 20+++++++++-----------
Mcc1/tests/test056.c | 24+++++++++++-------------
Mcc1/tests/test057.c | 12+++++-------
Mcc1/tests/test058.c | 12+++++-------
Mcc1/tests/test060.c | 4+---
Mcc1/tests/test061.c | 4+---
Mcc1/tests/test062.c | 4+---
Mcc1/tests/test064.c | 14++++++--------
Mcc1/tests/test065.c | 52+++++++++++++++++++++++++---------------------------
Mcc1/tests/test066.c | 10++++------
60 files changed, 857 insertions(+), 953 deletions(-)

diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -219,12 +219,16 @@ newstring(char *s, size_t len) { Symbol *sym = newsym(NS_IDEN); - sym->id = newid(); + if (lexmode != CPPMODE) { + sym->type = mktype(chartype, ARY, len, NULL); + sym->id = newid(); + } + sym->flags |= SSTRING | SCONSTANT | SPRIVATE; sym->u.s = xmalloc(len); if (s) memcpy(sym->u.s, s, len); - sym->type = mktype(chartype, ARY, len, NULL); + return sym; } diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c @@ -5,19 +5,17 @@ name: TEST001 description: Basic hello world test error: output: -V2 K #NC -V4 K #N9 -X8 I F "printf -G10 I F "main +X4 I F "printf +G6 I F "main { \ -V13 K #ND -Y12 V13 " ( +V8 K #ND +Y9 V8 " ( #"hello world #K0A #K00 ) - X8 Y12 'P pP cI + X4 Y9 'P pP cI h #I0 } */ diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c @@ -5,29 +5,27 @@ name: TEST002 description: Test forward references before definition of types error: output: -V2 K #NC -V4 K #N9 -G8 P "x -S6 "S #N8 #N2 -M9 I "i #N0 -M10 P "next #N2 -G12 I F "main +G4 P "x +S2 "S #N8 #N2 +M5 I "i #N0 +M6 P "next #N2 +G8 I F "main { \ -A13 S6 "y -A14 P "p -A15 N "n - A13 M9 .I #I0 :I - G8 @S6 A13 :S6 - A15 #N0 :N A14 A13 'P :P ,P - j L18 +A9 S2 "y +A10 P "p +A11 N "n + A9 M5 .I #I0 :I + G4 @S2 A9 :S2 + A11 #N0 :N A10 A9 'P :P ,P + j L14 e -L16 - A15 #N1 :+N A14 A14 @S6 M10 .P :P ,P -L18 - y L16 A14 #P0 !I +L12 + A11 #N1 :+N A10 A10 @S2 M6 .P :P ,P +L14 + y L12 A10 #P0 !I b -L17 +L13 } */ diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c @@ -5,22 +5,20 @@ name: TEST003 description: Select function to call inside ternary operator error: output: -V2 K #NC -V4 K #N9 -G6 I F "foo +G2 I F "foo { \ h #I2A } -G7 I F "bar +G3 I F "bar { \ h #I18 } -G8 I F "main +G4 I F "main { \ - h G6 cI + h G2 cI } */ diff --git a/cc1/tests/test004.c b/cc1/tests/test004.c @@ -5,30 +5,28 @@ name: TEST004 description: Test integer operations error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I0 :I - A7 A7 #I2 +I :I - A7 A7 #I1 -I :I - A7 A7 #I6 *I :I - A7 A7 #I2 /I :I - A7 A7 #I2 %I :I - A7 A7 #I2 lI :I - A7 A7 #I1 rI :I - A7 A7 #IFF |I :I - A7 A7 #I3 &I :I - A7 A7 #I1 ^I :I - A7 A7 A7 #I1 >I +I :I - A7 A7 A7 #I3 <I +I :I - A7 A7 A7 #I1 >I +I :I - A7 A7 A7 #I4 <I +I :I - y L8 A7 #I4 =I +A3 I "x + A3 #I0 :I + A3 A3 #I2 +I :I + A3 A3 #I1 -I :I + A3 A3 #I6 *I :I + A3 A3 #I2 /I :I + A3 A3 #I2 %I :I + A3 A3 #I2 lI :I + A3 A3 #I1 rI :I + A3 A3 #IFF |I :I + A3 A3 #I3 &I :I + A3 A3 #I1 ^I :I + A3 A3 A3 #I1 >I +I :I + A3 A3 A3 #I3 <I +I :I + A3 A3 A3 #I1 >I +I :I + A3 A3 A3 #I4 <I +I :I + y L4 A3 #I4 =I h #I1 -L8 +L4 h #I0 } */ diff --git a/cc1/tests/test005.c b/cc1/tests/test005.c @@ -5,20 +5,18 @@ name: TEST005 description: Test unary integer operations error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I3 :I - A7 A7 #I0 =I :I - A7 A7 #I0 =I :I - A7 A7 ~I :I - A7 A7 _I :I - y L8 A7 #I2 =I +A3 I "x + A3 #I3 :I + A3 A3 #I0 =I :I + A3 A3 #I0 =I :I + A3 A3 ~I :I + A3 A3 _I :I + y L4 A3 #I2 =I h #I1 -L8 +L4 h #I0 } */ diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c @@ -8,32 +8,30 @@ test006.c:5: warning: conditional expression is constant test006.c:7: warning: conditional expression is constant test006.c:10: warning: conditional expression is constant output: -V2 K #NC -V4 K #N9 -G5 K "c -G7 I F "main +G1 K "c +G3 I F "main { \ - y L8 #I1 + y L4 #I1 h #I1 - j L9 -L8 - y L10 #I1 - j L11 -L10 - y L12 #I0 - y L13 G5 gI #I0 =I + j L5 +L4 + y L6 #I1 + j L7 +L6 + y L8 #I0 + y L9 G1 gI #I0 =I h #I1 - j L14 -L13 + j L10 +L9 h #I0 -L14 - j L15 -L12 +L10 + j L11 +L8 h #I1 -L15 L11 -L9 +L7 +L5 h #I1 } */ diff --git a/cc1/tests/test007.c b/cc1/tests/test007.c @@ -5,22 +5,20 @@ name: TEST007 description: basic while test error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #IA :I - j L10 +A3 I "x + A3 #IA :I + j L6 e -L8 - A7 A7 #I1 -I :I -L10 - y L8 A7 #I0 !I +L4 + A3 A3 #I1 -I :I +L6 + y L4 A3 #I0 !I b -L9 - h A7 +L5 + h A3 } */ diff --git a/cc1/tests/test008.c b/cc1/tests/test008.c @@ -5,26 +5,24 @@ name: TEST008 description: Basic do while loop error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I0 :I +A3 I "x + A3 #I0 :I e -L8 - A7 A7 #I1 +I :I - y L8 A7 #IA <I +L4 + A3 A3 #I1 +I :I + y L4 A3 #IA <I b -L9 +L5 e -L10 - A7 A7 #I1 +I :I - y L10 A7 #I14 <I +L6 + A3 A3 #I1 +I :I + y L6 A3 #I14 <I b -L11 - h A7 #I14 -I +L7 + h A3 #I14 -I } */ diff --git a/cc1/tests/test009.c b/cc1/tests/test009.c @@ -5,24 +5,22 @@ name: TEST009 description: Basic test for loops error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I0 :I - j L10 +A3 I "x + A3 #I0 :I + j L6 e -L8 - A7 A7 #I1 +I :I -L10 - y L8 A7 #IA <I +L4 + A3 A3 #I1 +I :I +L6 + y L4 A3 #IA <I b -L9 - y L11 A7 #IA =I +L5 + y L7 A3 #IA =I h #I1 -L11 +L7 h #I0 } */ diff --git a/cc1/tests/test010.c b/cc1/tests/test010.c @@ -8,59 +8,57 @@ test010.c:8: warning: conditional expression is constant test010.c:10: warning: conditional expression is constant test010.c:30: warning: conditional expression is constant output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I0 :I - j L10 +A3 I "x + A3 #I0 :I + j L6 e -L8 +L4 + j L5 +L6 + y L4 #I1 + b +L5 j L9 + e +L7 + y L10 A3 #I5 !I + j L8 L10 - y L8 #I1 - b + A3 A3 #I1 +I :I + j L7 L9 + y L7 #I1 + b +L8 + j L13 e L11 - y L14 A7 #I5 !I + y L14 A3 #IA !I j L12 L14 - A7 A7 #I1 +I :I + A3 A3 #I1 +I :I j L11 + L13 - y L11 #I1 + j L11 + b L12 - - j L17 e L15 - y L18 A7 #IA !I + y L17 A3 #IF !I j L16 -L18 - A7 A7 #I1 +I :I - j L15 - L17 + A3 A3 #I1 +I :I j L15 - + y L15 #I1 b L16 - e -L19 - y L21 A7 #IF !I - j L20 -L21 - A7 A7 #I1 +I :I - j L19 - y L19 #I1 - b -L20 - h A7 #IF -I + h A3 #IF -I } */ diff --git a/cc1/tests/test011.c b/cc1/tests/test011.c @@ -7,19 +7,17 @@ error: test011.c:13: warning: 'foo' defined but not used test011.c:13: warning: 'start' defined but not used output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -L7 - j L8 +L3 + j L4 h #I1 -L9 +L5 h #I0 -L8 -L10 - j L9 +L4 +L6 + j L5 h #I1 } */ diff --git a/cc1/tests/test012.c b/cc1/tests/test012.c @@ -6,60 +6,58 @@ description: Basic switch test error: test012.c:38: warning: 'foo' defined but not used output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "x - A7 #I0 :I - s A7 +A3 I "x + A3 #I0 :I + s A3 + v L5 #I0 +L5 + t L4 +L4 + s A3 + v L7 #I0 +L7 + s A3 v L9 #I0 L9 + j L10 + f L11 +L11 + h #I1 t L8 L8 - s A7 - v L11 #I0 -L11 - s A7 - v L13 #I0 + t L6 +L6 + h #I2 +L10 + s A3 + v L13 #I1 L13 - j L14 - f L15 -L15 - h #I1 + h #I3 t L12 L12 - t L10 -L10 - h #I2 -L14 - s A7 - v L17 #I1 -L17 - h #I3 - t L16 + s A3 + A3 #I2 :I +L15 + v L16 #I1 L16 - s A7 - A7 #I2 :I -L19 - v L20 #I1 -L20 h #I4 - t L18 + t L14 +L14 + s A3 + v L18 #I0 L18 - s A7 - v L22 #I0 -L22 - h A7 - v L23 #I1 -L23 + h A3 + v L19 #I1 +L19 h #I1 - f L24 -L24 + f L20 +L20 h #I1 - t L21 -L21 + t L17 +L17 } */ diff --git a/cc1/tests/test013.c b/cc1/tests/test013.c @@ -8,132 +8,130 @@ comments: This test depends of the configuration in the type system. short is equal to int, and unsigned short is equal to unsigned. error: output: -V2 K #NC -V4 K #N9 -G5 I "a -G6 N "b -G7 K "c -G8 C "d -G9 K "e -G10 W "f -G11 Z "g -G12 Q "h -G13 O "i -G14 I "j -G15 N "k -G17 I F "main +G1 I "a +G2 N "b +G3 K "c +G4 C "d +G5 K "e +G6 W "f +G7 Z "g +G8 Q "h +G9 O "i +G10 I "j +G11 N "k +G13 I F "main { \ - G5 G6 gI :I - G5 G7 gI :I - G5 G8 gI :I - G5 G9 gI :I - G5 G10 gI :I - G5 G11 gI :I - G5 G12 gI :I - G5 G13 gI :I - G5 G14 :I - G5 G15 gI :I - G6 G5 gN :N - G6 G7 gN :N - G6 G8 gN :N - G6 G9 gN :N - G6 G10 gN :N - G6 G11 gN :N - G6 G12 gN :N - G6 G13 gN :N - G6 G14 gN :N - G6 G15 :N - G7 G5 gK :K - G7 G6 gK :K - G7 G8 gK :K - G7 G9 :K - G7 G10 gK :K - G7 G11 gK :K - G7 G12 gK :K - G7 G13 gK :K - G7 G14 gK :K - G7 G15 gK :K - G8 G5 gC :C - G8 G6 gC :C - G8 G7 gC :C - G8 G9 gC :C - G8 G10 gC :C - G8 G11 gC :C - G8 G12 gC :C - G8 G13 gC :C - G8 G14 gC :C - G8 G15 gC :C - G9 G5 gK :K - G9 G6 gK :K - G9 G7 :K - G9 G8 gK :K - G9 G10 gK :K - G9 G11 gK :K - G9 G12 gK :K - G9 G13 gK :K - G9 G14 gK :K - G9 G15 gK :K - G10 G5 gW :W - G10 G6 gW :W - G10 G7 gW :W - G10 G8 gW :W - G10 G9 gW :W - G10 G11 gW :W - G10 G12 gW :W - G10 G13 gW :W - G10 G14 gW :W - G10 G15 gW :W - G11 G5 gZ :Z - G11 G6 gZ :Z - G11 G7 gZ :Z - G11 G8 gZ :Z - G11 G9 gZ :Z - G11 G10 gZ :Z - G11 G12 gZ :Z - G11 G13 gZ :Z - G11 G14 gZ :Z - G11 G15 gZ :Z - G12 G5 gQ :Q - G12 G6 gQ :Q - G12 G7 gQ :Q - G12 G8 gQ :Q - G12 G9 gQ :Q - G12 G10 gQ :Q - G12 G11 gQ :Q - G12 G13 gQ :Q - G12 G14 gQ :Q - G12 G15 gQ :Q - G13 G5 gO :O - G13 G6 gO :O - G13 G7 gO :O - G13 G8 gO :O - G13 G9 gO :O - G13 G10 gO :O - G13 G11 gO :O - G13 G12 gO :O - G13 G14 gO :O - G13 G15 gO :O - G14 G5 :I - G14 G6 gI :I - G14 G7 gI :I - G14 G8 gI :I - G14 G9 gI :I - G14 G10 gI :I - G14 G11 gI :I - G14 G12 gI :I - G14 G13 gI :I - G14 G15 gI :I - G15 G5 gN :N - G15 G6 :N - G15 G7 gN :N - G15 G8 gN :N - G15 G9 gN :N - G15 G10 gN :N - G15 G11 gN :N - G15 G12 gN :N - G15 G14 gN :N - G15 G13 gN :N + G1 G2 gI :I + G1 G3 gI :I + G1 G4 gI :I + G1 G5 gI :I + G1 G6 gI :I + G1 G7 gI :I + G1 G8 gI :I + G1 G9 gI :I + G1 G10 :I + G1 G11 gI :I + G2 G1 gN :N + G2 G3 gN :N + G2 G4 gN :N + G2 G5 gN :N + G2 G6 gN :N + G2 G7 gN :N + G2 G8 gN :N + G2 G9 gN :N + G2 G10 gN :N + G2 G11 :N + G3 G1 gK :K + G3 G2 gK :K + G3 G4 gK :K + G3 G5 :K + G3 G6 gK :K + G3 G7 gK :K + G3 G8 gK :K + G3 G9 gK :K + G3 G10 gK :K + G3 G11 gK :K + G4 G1 gC :C + G4 G2 gC :C + G4 G3 gC :C + G4 G5 gC :C + G4 G6 gC :C + G4 G7 gC :C + G4 G8 gC :C + G4 G9 gC :C + G4 G10 gC :C + G4 G11 gC :C + G5 G1 gK :K + G5 G2 gK :K + G5 G3 :K + G5 G4 gK :K + G5 G6 gK :K + G5 G7 gK :K + G5 G8 gK :K + G5 G9 gK :K + G5 G10 gK :K + G5 G11 gK :K + G6 G1 gW :W + G6 G2 gW :W + G6 G3 gW :W + G6 G4 gW :W + G6 G5 gW :W + G6 G7 gW :W + G6 G8 gW :W + G6 G9 gW :W + G6 G10 gW :W + G6 G11 gW :W + G7 G1 gZ :Z + G7 G2 gZ :Z + G7 G3 gZ :Z + G7 G4 gZ :Z + G7 G5 gZ :Z + G7 G6 gZ :Z + G7 G8 gZ :Z + G7 G9 gZ :Z + G7 G10 gZ :Z + G7 G11 gZ :Z + G8 G1 gQ :Q + G8 G2 gQ :Q + G8 G3 gQ :Q + G8 G4 gQ :Q + G8 G5 gQ :Q + G8 G6 gQ :Q + G8 G7 gQ :Q + G8 G9 gQ :Q + G8 G10 gQ :Q + G8 G11 gQ :Q + G9 G1 gO :O + G9 G2 gO :O + G9 G3 gO :O + G9 G4 gO :O + G9 G5 gO :O + G9 G6 gO :O + G9 G7 gO :O + G9 G8 gO :O + G9 G10 gO :O + G9 G11 gO :O + G10 G1 :I + G10 G2 gI :I + G10 G3 gI :I + G10 G4 gI :I + G10 G5 gI :I + G10 G6 gI :I + G10 G7 gI :I + G10 G8 gI :I + G10 G9 gI :I + G10 G11 gI :I + G11 G1 gN :N + G11 G2 :N + G11 G3 gN :N + G11 G4 gN :N + G11 G5 gN :N + G11 G6 gN :N + G11 G7 gN :N + G11 G8 gN :N + G11 G10 gN :N + G11 G9 gN :N } */ diff --git a/cc1/tests/test014.c b/cc1/tests/test014.c @@ -20,30 +20,28 @@ test014.c:34: warning: 'f' defined but not used test014.c:34: warning: 'par' defined but not used test014.c:37: error: conflicting types for 'd' output: -V2 K #NC -V4 K #N9 -G5 I "a -Y6 K "b -X7 I "c -G10 I F "func1 +G1 I "a +Y2 K "b +X3 I "c +G6 I F "func1 { \ -A11 I "h -T12 K "i -R13 W "j -X14 I "k -T15 Z "a +A7 I "h +T8 K "i +R9 W "j +X10 I "k +T11 Z "a h #I0 } -G18 0 F "func2 +G14 0 F "func2 { -R16 I "par +R12 I "par \ -A19 I "par +A15 I "par } -T21 0 F "func3 +T17 0 F "func3 { -R20 I "par +R16 I "par \ } */ diff --git a/cc1/tests/test015.c b/cc1/tests/test015.c @@ -4,27 +4,25 @@ name: TEST015 description: Stress namespace mechanism error: -test015.c:56: error: label 's' already defined +test015.c:54: error: label 's' already defined output: -V2 K #NC -V4 K #N9 -S12 "s2 #N2 #N1 -M13 I "s #N0 -S9 "s1 #N4 #N1 -M10 I "s #N0 -M14 S12 "s1 #N2 -S6 "s #N4 #N1 -M15 S9 "s #N0 -G16 S6 "s2 -G18 I F "main +S8 "s2 #N2 #N1 +M9 I "s #N0 +S5 "s1 #N4 #N1 +M6 I "s #N0 +M10 S8 "s1 #N2 +S2 "s #N4 #N1 +M11 S5 "s #N0 +G12 S2 "s2 +G14 I F "main { \ - j L19 -A20 S6 "s -A21 I "s - h A21 - h A20 M15 .S9 M10 .I A20 M15 .S9 M14 .S12 M13 .I +I -L19 + j L15 +A16 S2 "s +A17 I "s + h A17 + h 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 @@ -7,42 +7,40 @@ error: test016.c:42: error: redefinition of 'func2' test016.c:46: error: incompatible types when assigning output: -V2 K #NC -V4 K #N9 -G5 I "g -G7 I F "func1 +G1 I "g +G3 I F "func1 { \ -A8 I "x -A10 P "p - G5 #I1 :I - A8 #I1 :I - A10 A8 'P :P - A10 @I #I0 :I - y L11 A8 #I0 =I +A4 I "x +A6 P "p + G1 #I1 :I + A4 #I1 :I + A6 A4 'P :P + A6 @I #I0 :I + y L7 A4 #I0 =I h #I1 -L11 - A10 G5 'P :P - A10 @I #I0 :I - y L12 A10 #P0 !I +L7 + A6 G1 'P :P + A6 @I #I0 :I + y L8 A6 #P0 !I h #I1 -L12 +L8 h #I0 } -G13 I F "func2 +G9 I F "func2 { \ -A14 I "x -A16 P "p -A18 P "pp - A14 #I1 :I - A16 A14 'P :P - A18 A16 'P :P - y L19 A16 #P0 =I - A18 @P @I #I0 :I -L19 - A16 #P0 :P - h A14 +A10 I "x +A12 P "p +A14 P "pp + A10 #I1 :I + A12 A10 'P :P + A14 A12 'P :P + y L15 A12 #P0 =I + A14 @P @I #I0 :I +L15 + A12 #P0 :P + h A10 } */ diff --git a/cc1/tests/test017.c b/cc1/tests/test017.c @@ -5,27 +5,25 @@ name: TEST017 description: Basic test about pointers and structs error: output: -V2 K #NC -V4 K #N9 -S6 "s1 #N4 #N1 -M7 I "y #N0 -M8 I "z #N2 -S10 "s2 #N4 #N2 -M12 P "p #N0 -G14 I F "main +S2 "s1 #N4 #N1 +M3 I "y #N0 +M4 I "z #N2 +S6 "s2 #N4 #N2 +M8 P "p #N0 +G10 I F "main { \ -A15 S6 "nested -A16 S10 "v - A16 M12 .P A15 'P :P - A16 M12 .P @S6 M7 .I #I1 :I - A16 M12 .P @S6 M8 .I #I2 :I - y L17 A15 M7 .I #I1 =I +A11 S2 "nested +A12 S6 "v + A12 M8 .P A11 'P :P + A12 M8 .P @S2 M3 .I #I1 :I + A12 M8 .P @S2 M4 .I #I2 :I + y L13 A11 M3 .I #I1 =I h #I1 -L17 - y L18 A15 M8 .I #I2 =I +L13 + y L14 A11 M4 .I #I2 =I h #I2 -L18 +L14 h #I0 } */ diff --git a/cc1/tests/test018.c b/cc1/tests/test018.c @@ -5,34 +5,32 @@ name: TEST018 description: Basic test for arrays error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -V7 K #N4 -V8 V7 #N2 -A9 V8 "arr -A11 P "p -A13 P "q -V14 I #N4 -A15 V14 "v - A11 A9 'P :P - A13 A9 'P #P4 +P #P3 +P :P - A9 'P #P4 +P #P3 +P @K #K2 :K - A15 #I2 :I - y L17 A9 'P #P4 +P #P3 +P @K gI #I2 =I +V3 K #N4 +V4 V3 #N2 +A5 V4 "arr +A7 P "p +A9 P "q +V10 I #N4 +A11 V10 "v + A7 A5 'P :P + A9 A5 'P #P4 +P #P3 +P :P + A5 'P #P4 +P #P3 +P @K #K2 :K + A11 #I2 :I + y L13 A5 'P #P4 +P #P3 +P @K gI #I2 =I h #I1 -L17 - y L18 A11 #P4 +P #P3 +P @K gI #I2 =I +L13 + y L14 A7 #P4 +P #P3 +P @K gI #I2 =I h #I1 -L18 - y L19 A13 @K gI #I2 =I +L14 + y L15 A9 @K gI #I2 =I h #I1 -L19 - y L20 A15 #I2 =I +L15 + y L16 A11 #I2 =I h #I1 -L20 +L16 h #I0 } */ diff --git a/cc1/tests/test019.c b/cc1/tests/test019.c @@ -7,31 +7,29 @@ error: test019.c:12: warning: division by 0 test019.c:13: warning: division by 0 output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "i - A7 #I3 :I - A7 #I1 :I - A7 #I12 :I - A7 #I2 :I - A7 #I0 :I - A7 A7 #I0 %I :I - A7 A7 #I0 %I :I - A7 #I8 :I - A7 #I2 :I - A7 #I4 :I - A7 #IC :I - A7 #I8 :I - A7 #IFFFD :I - A7 #IFFF3 :I - A7 #I1 :I - A7 #I0 :I - A7 #I0 :I - A7 #I1 :I - A7 #I0 :I +A3 I "i + A3 #I3 :I + A3 #I1 :I + A3 #I12 :I + A3 #I2 :I + A3 #I0 :I + A3 A3 #I0 %I :I + A3 A3 #I0 %I :I + A3 #I8 :I + A3 #I2 :I + A3 #I4 :I + A3 #IC :I + A3 #I8 :I + A3 #IFFFD :I + A3 #IFFF3 :I + A3 #I1 :I + A3 #I0 :I + A3 #I0 :I + A3 #I1 :I + A3 #I0 :I } */ diff --git a/cc1/tests/test020.c b/cc1/tests/test020.c @@ -4,46 +4,44 @@ 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: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "i - A7 A7 #I0 !I :I - A7 A7 #I0 !I #I1 ,I :I - A7 #I1 :I - A7 A7 #I0 !I :I - A7 A7 #I0 !I #I0 ,I :I - A7 A7 #I0 !I :I - A7 A7 #I0 !I :I - A7 #I0 :I - A7 A7 :I - A7 #I0 :I - A7 A7 :I - A7 #I0 :I - A7 A7 :I - A7 A7 :I - A7 A7 :I - A7 #I0 A7 -I :I - A7 A7 :I - A7 A7 :I - A7 A7 :I - A7 A7 :I - A7 A7 #I0 ,I :I - A7 A7 #I0 ,I :I - A7 A7 :I - A7 A7 :I - A7 A7 :I - A7 #I1 A7 /I :I - A7 A7 :I - A7 A7 :I - A7 A7 #I1 ,I :I - A7 A7 #I0 /I :I - A7 A7 #I0 %I :I +A3 I "i + A3 A3 #I0 !I :I + A3 A3 #I0 !I #I1 ,I :I + A3 #I1 :I + A3 A3 #I0 !I :I + A3 A3 #I0 !I #I0 ,I :I + A3 A3 #I0 !I :I + A3 A3 #I0 !I :I + A3 #I0 :I + A3 A3 :I + A3 #I0 :I + A3 A3 :I + A3 #I0 :I + A3 A3 :I + A3 A3 :I + A3 A3 :I + A3 #I0 A3 -I :I + A3 A3 :I + A3 A3 :I + A3 A3 :I + A3 A3 :I + A3 A3 #I0 ,I :I + A3 A3 #I0 ,I :I + A3 A3 :I + A3 A3 :I + A3 A3 :I + A3 #I1 A3 /I :I + A3 A3 :I + A3 A3 :I + A3 A3 #I1 ,I :I + A3 A3 #I0 /I :I + A3 A3 #I0 %I :I } */ diff --git a/cc1/tests/test021.c b/cc1/tests/test021.c @@ -6,23 +6,21 @@ description: Basic test for char constants comments: This test is done for z80 implementation error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 K "uc -A8 C "sc - A7 #KFF :K - A7 #K23 :K - A7 #K1 :K - A7 #K1 :K - A7 #K41 :K - A8 #CFF :C - A8 #C23 :C - A8 #C1 :C - A8 #C1 :C - A8 #C41 :C +A3 K "uc +A4 C "sc + A3 #KFF :K + A3 #K23 :K + A3 #K1 :K + A3 #K1 :K + A3 #K41 :K + A4 #CFF :C + A4 #C23 :C + A4 #C1 :C + A4 #C1 :C + A4 #C41 :C } */ diff --git a/cc1/tests/test022.c b/cc1/tests/test022.c @@ -6,29 +6,27 @@ description: Basic test for int constants comments: This test is done for z80 data types error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "i -A8 N "u - A7 #I1 :I - A7 #IFFFF :I - A7 #IFFFF :I - A7 #IFFFF :I - A7 #IFFFF :I - A7 #I3 :I - A7 #I1 :I - A7 #I0 :I - A8 #N1 :N - A8 #NFFFF :N - A8 #NFFFF :N - A8 #NFFFF :N - A8 #NFFFF :N - A8 #N0 :N - A8 #N3 :N - A8 #N0 :N +A3 I "i +A4 N "u + A3 #I1 :I + A3 #IFFFF :I + A3 #IFFFF :I + A3 #IFFFF :I + A3 #IFFFF :I + A3 #I3 :I + A3 #I1 :I + A3 #I0 :I + A4 #N1 :N + A4 #NFFFF :N + A4 #NFFFF :N + A4 #NFFFF :N + A4 #NFFFF :N + A4 #N0 :N + A4 #N3 :N + A4 #N0 :N h #I0 } */ diff --git a/cc1/tests/test023.c b/cc1/tests/test023.c @@ -6,29 +6,27 @@ description: Basic test for long constants comments: This test is done for z80 data types error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 W "i -A8 Z "u - A7 #W1 :W - A7 #WFFFFFFFF :W - A7 #WFFFFFFFF :W - A7 #WFFFF :W - A7 #WFFFFFFFF :W - A7 #W3 :W - A7 #W1 :W - A7 #W0 :W - A8 #Z1 :Z - A8 #ZFFFFFFFF :Z - A8 #ZFFFFFFFF :Z - A8 #ZFFFF :Z - A8 #ZFFFFFFFF :Z - A8 #Z3 :Z - A8 #Z1 :Z - A8 #Z0 :Z +A3 W "i +A4 Z "u + A3 #W1 :W + A3 #WFFFFFFFF :W + A3 #WFFFFFFFF :W + A3 #WFFFF :W + A3 #WFFFFFFFF :W + A3 #W3 :W + A3 #W1 :W + A3 #W0 :W + A4 #Z1 :Z + A4 #ZFFFFFFFF :Z + A4 #ZFFFFFFFF :Z + A4 #ZFFFF :Z + A4 #ZFFFFFFFF :Z + A4 #Z3 :Z + A4 #Z1 :Z + A4 #Z0 :Z h #I0 } */ diff --git a/cc1/tests/test024.c b/cc1/tests/test024.c @@ -6,27 +6,25 @@ description: Basic test for long long constants comments: This test is done for z80 data types error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 Q "i -A8 O "u - A7 #Q1 :Q - A7 #QFFFFFFFFFFFFFFFF :Q - A7 #QFFFFFFFFFFFFFFFF :Q - A7 #QFFFF :Q - A7 #QFFFFFFFFFFFFFFFF :Q - A7 #Q3 :Q - A7 #Q1 :Q - A8 #O1 :O - A8 #OFFFFFFFFFFFFFFFF :O - A8 #OFFFFFFFFFFFFFFFF :O - A8 #OFFFF :O - A8 #OFFFFFFFFFFFFFFFF :O - A8 #O3 :O - A8 #O0 :O +A3 Q "i +A4 O "u + A3 #Q1 :Q + A3 #QFFFFFFFFFFFFFFFF :Q + A3 #QFFFFFFFFFFFFFFFF :Q + A3 #QFFFF :Q + A3 #QFFFFFFFFFFFFFFFF :Q + A3 #Q3 :Q + A3 #Q1 :Q + A4 #O1 :O + A4 #OFFFFFFFFFFFFFFFF :O + A4 #OFFFFFFFFFFFFFFFF :O + A4 #OFFFF :O + A4 #OFFFFFFFFFFFFFFFF :O + A4 #O3 :O + A4 #O0 :O h #I0 } */ diff --git a/cc1/tests/test025.c b/cc1/tests/test025.c @@ -5,18 +5,16 @@ name: TEST025 descritpion: Test of ifdef and ifndef error: output: -V2 K #NC -V4 K #N9 -G5 I "a -G6 I "b -G7 I "c -G8 I "d -G9 I "_1 -G10 I "_2 -G11 I "e_ -G12 I "f_ -G13 I "h -G14 I "i +G1 I "a +G2 I "b +G3 I "c +G4 I "d +G5 I "_1 +G6 I "_2 +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 @@ -5,24 +5,22 @@ name: TEST026 descritpion: Test of predefined cpp macros error: output: -V2 K #NC -V4 K #N9 -G7 I F "main +G3 I F "main { \ -A8 I "y -A10 P "p -V12 K #NA -Y11 V12 " ( +A4 I "y +A6 P "p +V7 K #NA +Y8 V7 " ( #"test026.c #K00 ) - A10 Y11 'P :P - A8 #I26 :I - A8 #I1 :I - A8 #I1 :I - A8 #I1 :I - A8 #I1 :I + A6 Y8 'P :P + A4 #I24 :I + A4 #I1 :I + A4 #I1 :I + A4 #I1 :I + A4 #I1 :I } */ diff --git a/cc1/tests/test027.c b/cc1/tests/test027.c @@ -5,19 +5,17 @@ name: TEST027 description: Test of cpp stringizer error: output: -V2 K #NC -V4 K #N9 -G7 I F "main +G3 I F "main { \ -A9 P "p -V11 K #N19 -Y10 V11 " ( +A5 P "p +V6 K #N19 +Y7 V6 " ( #"hello is better than bye #K00 ) - A9 Y10 'P :P - h A9 @K gI + A5 Y7 'P :P + h A5 @K gI } */ diff --git a/cc1/tests/test028.c b/cc1/tests/test028.c @@ -5,17 +5,15 @@ name: TEST028 description: Test of reinterpretation in define error: output: -V2 K #NC -V4 K #N9 -G10 P F "foo +G6 P F "foo { \ -V12 K #N3 -Y14 V12 " ( +V7 K #N3 +Y10 V7 " ( #"hi #K00 ) - h Y14 'P + h Y10 'P } */ diff --git a/cc1/tests/test029.c b/cc1/tests/test029.c @@ -7,18 +7,16 @@ 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:34: warning: expression without side effects -test029.c:39: error: redefinition of 'f1' -test029.c:40: error: 'f' undeclared -test029.c:40: warning: expression without side effects +test029.c:32: warning: expression without side effects +test029.c:37: error: redefinition of 'f1' +test029.c:38: error: 'f' undeclared +test029.c:38: warning: expression without side effects output: -V2 K #NC -V4 K #N9 -G7 I F "f1 +G3 I F "f1 { \ -A8 I "f - A8 #I2 *I +A4 I "f + A4 #I2 *I } */ diff --git a/cc1/tests/test030.c b/cc1/tests/test030.c @@ -5,32 +5,30 @@ name: TEST030 description: Basic test for vararg functions error: output: -V2 K #NC -V4 K #N9 -S6 "foo #N18 #N2 -M7 I "i #N0 -M8 I "j #N2 -M9 I "k #N4 -M11 P "p #N6 -M12 J "v #N8 -G18 I F "f1 +S2 "foo #N18 #N2 +M3 I "i #N0 +M4 I "j #N2 +M5 I "k #N4 +M7 P "p #N6 +M8 J "v #N8 +G14 I F "f1 { -A13 S6 "f -A15 P "p -A16 I "n +A9 S2 "f +A11 P "p +A12 I "n \ - y L19 A13 M7 .I A15 @S6 M7 .I =I + y L15 A9 M3 .I A11 @S2 M3 .I =I h #I0 -L19 - h A15 @S6 M8 .I A16 +I +L15 + h A11 @S2 M4 .I A12 +I } -G21 I F "main +G17 I F "main { \ -A22 S6 "f - A22 M7 .I A22 M8 .I #I1 :I :I - G18 A22 pS6 A22 'P pP #I2 pI cI - G18 A22 pS6 A22 'P pP #I2 pI #I1 pI A22 pS6 A22 'P pP cI +A18 S2 "f + A18 M3 .I A18 M4 .I #I1 :I :I + G14 A18 pS2 A18 'P pP #I2 pI cI + G14 A18 pS2 A18 'P pP #I2 pI #I1 pI A18 pS2 A18 'P pP cI h #I0 } */ diff --git a/cc1/tests/test032.c b/cc1/tests/test032.c @@ -5,20 +5,17 @@ name: TEST032 description: test special characters @ and $ in macro definitions error: output: -V2 K #NC -V4 K #N9 -V7 K #N1E -G9 I F "main +G3 I F "main { \ -V13 K #N2C -Y12 V13 " ( +V6 K #N2C +Y7 V6 " ( #"This is a string $ or # or ##and it is ok ! #K00 ) -A11 P "p - A11 Y12 'P :P - h A11 #P0 !I +A5 P "p + A5 Y7 'P :P + h A5 #P0 !I } */ diff --git a/cc1/tests/test033.c b/cc1/tests/test033.c @@ -5,9 +5,7 @@ name: TEST033 description: test for #if defined() error: output: -V2 K #NC -V4 K #N9 -G5 I "c +G1 I "c */ #if defined(FOO) diff --git a/cc1/tests/test034.c b/cc1/tests/test034.c @@ -4,28 +4,26 @@ name: TEST034 description: Basic test for incomplete structures error: -test034.c:50: error: declared variable 'bar' of incomplete type -test034.c:50: error: redeclaration of 'bar' +test034.c:48: error: declared variable 'bar' of incomplete type +test034.c:48: error: redeclaration of 'bar' output: -V2 K #NC -V4 K #N9 -X7 S6 "x -X9 I F "foo -G10 I F "main +X3 S2 "x +X5 I F "foo +G6 I F "main { \ -X11 S6 "x - h X11 'P #P0 !I +X7 S2 "x + h X7 'P #P0 !I } -S6 "X #N2 #N1 -M13 I "v #N0 -G9 I F "foo +S2 "X #N2 #N1 +M9 I "v #N0 +G5 I F "foo { \ - X7 M13 .I #I0 :I - h X7 M13 .I + X3 M9 .I #I0 :I + h X3 M9 .I } -X17 S15 "bar2 +X13 S11 "bar2 */ extern struct X x; diff --git a/cc1/tests/test035.c b/cc1/tests/test035.c @@ -5,8 +5,25 @@ name: TEST035 description: Basic test for enumerations error: output: -V2 K #NC -V4 K #N9 +G7 I F "main +{ +\ +A8 I "e + A8 #I3 :I + y L9 A8 #I1 =I + h #I0 +L9 + y L10 A8 #I0 =I + h #I1 +L10 + y L11 A8 #I2 =I + h #I2 +L11 + y L12 A8 #I3 =I + h #I3 +L12 + h #I0 +} */ enum E { diff --git a/cc1/tests/test036.c b/cc1/tests/test036.c @@ -4,50 +4,48 @@ name: TEST036 description: Duff's device error: -test036.c:61: warning: type defaults to 'int' in declaration +test036.c:59: warning: type defaults to 'int' in declaration output: -V2 K #NC -V4 K #N9 -G9 I F "send +G5 I F "send { -R5 P "to -R6 P "from -R7 I "count +R1 P "to +R2 P "from +R3 I "count \ -R11 I "n - R11 R7 #I7 +I #I8 /I :I - s R7 #I8 %I - v L13 #I0 -L13 +R7 I "n + R7 R3 #I7 +I #I8 /I :I + s R3 #I8 %I + v L9 #I0 +L9 e +L10 + R1 @I R2 #P2 :iP @I :I + v L12 #I7 +L12 + R1 @I R2 #P2 :iP @I :I + v L13 #I6 +L13 + R1 @I R2 #P2 :iP @I :I + v L14 #I5 L14 - R5 @I R6 #P2 :iP @I :I - v L16 #I7 + R1 @I R2 #P2 :iP @I :I + v L15 #I4 +L15 + R1 @I R2 #P2 :iP @I :I + v L16 #I3 L16 - R5 @I R6 #P2 :iP @I :I - v L17 #I6 + R1 @I R2 #P2 :iP @I :I + v L17 #I2 L17 - R5 @I R6 #P2 :iP @I :I - v L18 #I5 + R1 @I R2 #P2 :iP @I :I + v L18 #I1 L18 - R5 @I R6 #P2 :iP @I :I - v L19 #I4 -L19 - R5 @I R6 #P2 :iP @I :I - v L20 #I3 -L20 - R5 @I R6 #P2 :iP @I :I - v L21 #I2 -L21 - R5 @I R6 #P2 :iP @I :I - v L22 #I1 -L22 - R5 @I R6 #P2 :iP @I :I - y L14 R11 #I1 :-I #I0 >I + R1 @I R2 #P2 :iP @I :I + y L10 R7 #I1 :-I #I0 >I b -L15 - t L12 -L12 +L11 + t L8 +L8 } */ diff --git a/cc1/tests/test037.c b/cc1/tests/test037.c @@ -5,24 +5,22 @@ name: TEST037 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: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ - y L7 #I1 + y L3 #I1 h #I1 -L7 - y L8 #I1 +L3 + y L4 #I1 h #I2 -L8 - y L9 #I1 +L4 + y L5 #I1 h #I3 -L9 +L5 h #I0 } */ diff --git a/cc1/tests/test038.c b/cc1/tests/test038.c @@ -4,25 +4,23 @@ name: TEST038 description: Basic test for tentative definitions error: -test038.c:47: error: redeclaration of 'x' +test038.c:45: error: redeclaration of 'x' output: -V2 K #NC -V4 K #N9 -G5 I "x -G5 I "x ( +G1 I "x +G1 I "x ( #I0 ) -X7 I F "main -G9 P F "foo +X3 I F "main +G5 P F "foo { \ - h X7 'P + h X3 'P } -G7 I F "main +G3 I F "main { \ - G5 #I0 :I - h G5 + G1 #I0 :I + h G1 } */ diff --git a/cc1/tests/test039.c b/cc1/tests/test039.c @@ -6,30 +6,28 @@ description: Test of integer constants comments: This test is done for z80 sizes error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "i -A8 N "u -A9 W "l -A10 Z "ul -A11 Q "ll -A12 O "ull - A7 #I1 :I - A7 #I1 :I - A8 #N1 :N - A8 #N1 :N - A9 #W1 :W - A9 #W0 :W - A8 #N0 :N - A10 #Z1 :Z - A9 #W1 :W - A11 #Q0 :Q - A10 #Z0 :Z - A12 #O1 :O - A12 #O1 :O +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 h #I0 } */ diff --git a/cc1/tests/test040.c b/cc1/tests/test040.c @@ -5,17 +5,15 @@ name: TEST040 description: Test for bug parsing typenames in struct definition error: output: -V2 K #NC -V4 K #N9 -S6 "List #NC #N2 -M8 I "len #N0 -M10 P "head #N2 -M11 P "back #N4 -G13 I F "main +S2 "List #NC #N2 +M4 I "len #N0 +M6 P "head #N2 +M7 P "back #N4 +G9 I F "main { \ -A14 S6 "List - h A14 M8 .I +A10 S2 "List + h A10 M4 .I } */ diff --git a/cc1/tests/test041.c b/cc1/tests/test041.c @@ -4,34 +4,32 @@ name: TEST041 description: Test for bug parsing ternary operators error: -test041.c:53: error: type mismatch in conditional expression -test041.c:53: error: incompatible types when assigning -test041.c:54: error: used struct/union type value where scalar is required -test041.c:54: warning: expression without side effects -test041.c:55: warning: 'i' defined but not used -test041.c:55: warning: 'foo' defined but not used -test041.c:55: warning: 's' defined but not used +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:52: warning: expression without side effects +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: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -A7 I "i -A9 P "q -A11 P "s -A12 P "p -S14 "foo #N2 #N1 -M15 I "i #N0 -A16 S14 "foo - A7 A7 #I0 !I #W0 #W0 ?W gI :I - A12 A7 #I0 !I #P0 #P0 ?P :P - A12 A7 #I0 !I #P0 #P0 ?P :P - A12 A7 #I0 !I #P0 #P0 ?P :P - A9 A7 #I0 !I #P0 A12 ?P :P - A9 A7 #I0 !I A12 #P0 ?P :P - A9 A7 #I0 !I A9 #P0 ?P :P - A9 A7 #I0 !I #P0 A9 ?P :P +A3 I "i +A5 P "q +A7 P "s +A8 P "p +S10 "foo #N2 #N1 +M11 I "i #N0 +A12 S10 "foo + A3 A3 #I0 !I #W0 #W0 ?W gI :I + A8 A3 #I0 !I #P0 #P0 ?P :P + A8 A3 #I0 !I #P0 #P0 ?P :P + A8 A3 #I0 !I #P0 #P0 ?P :P + A5 A3 #I0 !I #P0 A8 ?P :P + 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 diff --git a/cc1/tests/test042.c b/cc1/tests/test042.c @@ -4,14 +4,12 @@ name: TEST042 description: Test for bug parsing ternary operators error: -test042.c:22: error: bad type conversion requested +test042.c:20: error: bad type conversion requested output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ -X8 0 F "f +X4 0 F "f */ int diff --git a/cc1/tests/test043.c b/cc1/tests/test043.c @@ -5,16 +5,14 @@ name: TEST043 description: Test for double typedef (taken from plan9 kernel) error: output: -V2 K #NC -V4 K #N9 -S6 "Clock0link #N8 #N2 -M10 P "clock #N0 -M12 P "link #N2 -G13 S6 "cl0 -G15 I F "main +S2 "Clock0link #N8 #N2 +M6 P "clock #N0 +M8 P "link #N2 +G9 S2 "cl0 +G11 I F "main { \ - G13 M10 .P @F c0 + G9 M6 .P @F c0 h #I0 } */ diff --git a/cc1/tests/test045.c b/cc1/tests/test045.c @@ -5,17 +5,15 @@ name: TEST045 description: Basic test of initializers error: output: -V2 K #NC -V4 K #N9 -G5 I "x ( +G1 I "x ( #I5 ) -G7 I F "main +G3 I F "main { \ - y L8 G5 #I5 =I + y L4 G1 #I5 =I h #I1 -L8 +L4 h #I0 } */ diff --git a/cc1/tests/test046.c b/cc1/tests/test046.c @@ -5,26 +5,24 @@ name: TEST046 description: Basic test for initializators error: output: -V2 K #NC -V4 K #N9 -V5 I #N3 -G6 V5 "x ( +V1 I #N3 +G2 V1 "x ( #I1 #I2 #I3 ) -G8 I F "main +G4 I F "main { \ - y L9 G6 #I1 =I + y L5 G2 #I1 =I h #I1 -L9 - y L11 G6 'P #P2 +P @I #I2 =I +L5 + y L7 G2 'P #P2 +P @I #I2 =I h #I2 -L11 - y L12 G6 'P #P4 +P @I #I3 =I +L7 + y L8 G2 'P #P4 +P @I #I3 =I h #I3 -L12 +L8 h #I0 } */ diff --git a/cc1/tests/test047.c b/cc1/tests/test047.c @@ -5,29 +5,27 @@ name: TEST047 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -S6 "S #N6 #N1 -M7 I "a #N0 -M8 I "b #N2 -M9 I "c #N4 -G10 S6 "x ( +S2 "S #N6 #N1 +M3 I "a #N0 +M4 I "b #N2 +M5 I "c #N4 +G6 S2 "x ( #I1 #I2 #I3 ) -G12 I F "main +G8 I F "main { \ - y L13 G10 M7 .I #I1 =I + y L9 G6 M3 .I #I1 =I h #I1 -L13 - y L14 G10 M8 .I #I2 =I +L9 + y L10 G6 M4 .I #I2 =I h #I2 -L14 - y L15 G10 M9 .I #I3 =I +L10 + y L11 G6 M5 .I #I3 =I h #I3 -L15 +L11 h #I0 } */ diff --git a/cc1/tests/test048.c b/cc1/tests/test048.c @@ -5,25 +5,23 @@ name: TEST048 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -S6 "S #N4 #N1 -M7 I "a #N0 -M8 I "b #N2 -V9 S6 #N1 -G10 V9 "x ( +S2 "S #N4 #N1 +M3 I "a #N0 +M4 I "b #N2 +V5 S2 #N1 +G6 V5 "x ( #I1 #I2 ) -G12 I F "main +G8 I F "main { \ - y L13 G10 M7 .I #I1 =I + y L9 G6 M3 .I #I1 =I h #I1 -L13 - y L15 G10 M8 .I #I2 =I +L9 + y L11 G6 M4 .I #I2 =I h #I2 -L15 +L11 h #I0 } */ diff --git a/cc1/tests/test049.c b/cc1/tests/test049.c @@ -5,20 +5,18 @@ name: TEST049 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -G5 I "x ( +G1 I "x ( #I5 ) -G7 P "p ( - G5 'P +G3 P "p ( + G1 'P ) -G9 I F "main +G5 I F "main { \ - y L10 G7 @I #I5 =I + y L6 G3 @I #I5 =I h #I1 -L10 +L6 h #I0 } */ diff --git a/cc1/tests/test051.c b/cc1/tests/test051.c @@ -5,26 +5,24 @@ name: TEST051 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -V5 I #N3 -G6 V5 "arr ( +V1 I #N3 +G2 V1 "arr ( #I0 #I1 #I2 ) -G8 I F "main +G4 I F "main { \ - y L9 G6 #I0 =I + y L5 G2 #I0 =I h #I1 -L9 - y L11 G6 'P #P2 +P @I #I1 =I +L5 + y L7 G2 'P #P2 +P @I #I1 =I h #I2 -L11 - y L12 G6 'P #P4 +P @I #I2 =I +L7 + y L8 G2 'P #P4 +P @I #I2 =I h #I3 -L12 +L8 h #I0 } */ diff --git a/cc1/tests/test052.c b/cc1/tests/test052.c @@ -5,33 +5,31 @@ name: TEST052 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -S6 "S #N4 #N1 -M7 I "a #N0 -M8 I "b #N2 -V9 S6 #N2 -G10 V9 "arr ( +S2 "S #N4 #N1 +M3 I "a #N0 +M4 I "b #N2 +V5 S2 #N2 +G6 V5 "arr ( #I1 #I2 #I3 #I4 ) -G12 I F "main +G8 I F "main { \ - y L13 G10 M7 .I #I1 =I + y L9 G6 M3 .I #I1 =I h #I1 -L13 - y L15 G10 M8 .I #I2 =I +L9 + y L11 G6 M4 .I #I2 =I h #I2 -L15 - y L16 G10 'P #P4 +P @S6 M7 .I #I3 =I +L11 + y L12 G6 'P #P4 +P @S2 M3 .I #I3 =I h #I3 -L16 - y L17 G10 'P #P4 +P @S6 M8 .I #I4 =I +L12 + y L13 G6 'P #P4 +P @S2 M4 .I #I4 =I h #I4 -L17 +L13 h #I0 } */ diff --git a/cc1/tests/test053.c b/cc1/tests/test053.c @@ -5,24 +5,22 @@ name: TEST053 description: Basic test for initializer error: output: -V2 K #NC -V4 K #N9 -S6 "S #N4 #N1 -M7 I "a #N0 -M8 I "b #N2 -G9 S6 "s ( +S2 "S #N4 #N1 +M3 I "a #N0 +M4 I "b #N2 +G5 S2 "s ( #I1 #I2 ) -G11 I F "main +G7 I F "main { \ - y L12 G9 M7 .I #I1 =I + y L8 G5 M3 .I #I1 =I h #I1 -L12 - y L13 G9 M8 .I #I2 =I +L8 + y L9 G5 M4 .I #I2 =I h #I2 -L13 +L9 h #I0 } */ diff --git a/cc1/tests/test056.c b/cc1/tests/test056.c @@ -5,16 +5,14 @@ name: TEST056 desciption: Test of overlaying designators error: output: -V2 K #NC -V4 K #N9 -V10 K #N3 -S6 "S #NB #N1 -M7 I "a #N0 -M8 I "b #N2 -M9 I "c #N4 -M11 V10 "d #N6 -M12 I "e #N9 -G13 S6 "s ( +V6 K #N3 +S2 "S #NB #N1 +M3 I "a #N0 +M4 I "b #N2 +M5 I "c #N4 +M7 V6 "d #N6 +M8 I "e #N9 +G9 S2 "s ( #I1 #I2 #I0 @@ -23,12 +21,12 @@ G13 S6 "s ( #K0 #I0 ) -G15 V14 "m ( +G11 V10 "m ( ) -G17 I F "main +G13 I F "main { \ - h G13 M11 .V10 'P #P2 +P @K gI gN #N0 =I + h G9 M7 .V6 'P #P2 +P @K gI gN #N0 =I } */ diff --git a/cc1/tests/test057.c b/cc1/tests/test057.c @@ -5,10 +5,8 @@ name: TEST057 description: test of initialization of incomplete arrays error: output: -V2 K #NC -V4 K #N9 -V5 I #N3 -G7 V6 "arr1 ( +V1 I #N3 +G3 V2 "arr1 ( #I2 #I7 #I5 @@ -16,7 +14,7 @@ G7 V6 "arr1 ( #I1 #I2 ) -G8 V6 "arr2 ( +G4 V2 "arr2 ( #I2 #I7 #I5 @@ -24,10 +22,10 @@ G8 V6 "arr2 ( #I1 #I2 ) -G10 I F "main +G6 I F "main { \ - h G7 'P #P6 +P #P4 +P @I G8 'P #P6 +P #P6 +P @I !I + h G3 'P #P6 +P #P4 +P @I G4 'P #P6 +P #P6 +P @I !I } */ diff --git a/cc1/tests/test058.c b/cc1/tests/test058.c @@ -5,11 +5,9 @@ name: TEST058 description: Test of initialization mixing designators and sequence error: output: -V2 K #NC -V4 K #N9 -V5 I #N5 -V6 V5 #N3 -G8 V7 "arr ( +V1 I #N5 +V2 V1 #N3 +G4 V3 "arr ( #I0 #I0 #I3 @@ -41,10 +39,10 @@ G8 V7 "arr ( #I0 #I0 ) -G10 I F "main +G6 I F "main { \ - h G8 'P #PA +P #P8 +P @I G8 'P #P1E +P #PA +P #P8 +P @I !I + h G4 'P #PA +P #P8 +P @I G4 'P #P1E +P #PA +P #P8 +P @I !I } */ diff --git a/cc1/tests/test060.c b/cc1/tests/test060.c @@ -5,9 +5,7 @@ name: TEST060 description: Test for correctness of #line error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ h #I0 diff --git a/cc1/tests/test061.c b/cc1/tests/test061.c @@ -5,9 +5,7 @@ name: TEST061 description: Test for macros without arguments but with parenthesis error: output: -V2 K #NC -V4 K #N9 -G7 I F "main +G3 I F "main { \ h #I1 diff --git a/cc1/tests/test062.c b/cc1/tests/test062.c @@ -5,9 +5,7 @@ name: TEST062 description: Test for hexadecimal numbers in upper and lower case error: output: -V2 K #NC -V4 K #N9 -G6 I F "main +G2 I F "main { \ h #I1 diff --git a/cc1/tests/test064.c b/cc1/tests/test064.c @@ -5,16 +5,14 @@ name: TEST064 description: Test function alike macro without parenthesis error: output: -V2 K #NC -V4 K #N9 -S5 " #N2 #N1 -M6 I "f #N0 -G9 I F "main +S1 " #N2 #N1 +M2 I "f #N0 +G5 I F "main { \ -A10 S5 "s - A10 M6 .I #I0 :I - h A10 M6 .I +A6 S1 "s + A6 M2 .I #I0 :I + h A6 M2 .I } */ diff --git a/cc1/tests/test065.c b/cc1/tests/test065.c @@ -4,41 +4,39 @@ name: TEST065 description: Test decay mixed with * operators error: -test065.c:67: error: increment of pointer to an incomplete type -test065.c:67: error: invalid use of undefined type -test065.c:68: warning: 'argv' defined but not used +test065.c:65: error: increment of pointer to an incomplete type +test065.c:65: error: invalid use of undefined type +test065.c:66: warning: 'argv' defined but not used output: -V2 K #NC -V4 K #N9 -G11 I F "main +G7 I F "main { -A5 I "argc -A9 P "argv +A1 I "argc +A5 P "argv \ -V12 I #N1 -A13 V12 "v -A16 P "p -A18 P "f1 -A19 P "f2 - A13 #I0 :I - A16 A13 'P :P - A18 G11 'P :P - A19 G11 'P :P - y L22 A5 #I0 !I +V8 I #N1 +A9 V8 "v +A12 P "p +A14 P "f1 +A15 P "f2 + A9 #I0 :I + A12 A9 'P :P + A14 G7 'P :P + A15 G7 'P :P + y L18 A1 #I0 !I h #I1 -L22 - y L23 G11 #I0 pI #P0 pP cI #I0 =I +L18 + y L19 G7 #I0 pI #P0 pP cI #I0 =I h #I2 -L23 - y L24 A18 @F #I0 pI #P0 pP cI #I0 =I +L19 + y L20 A14 @F #I0 pI #P0 pP cI #I0 =I h #I3 -L24 - y L25 A19 @F #I0 pI #P0 pP cI #I0 =I +L20 + y L21 A15 @F #I0 pI #P0 pP cI #I0 =I h #I4 -L25 - y L26 A16 @I #I0 !I +L21 + y L22 A12 @I #I0 !I h #I0 -L26 +L22 */ int diff --git a/cc1/tests/test066.c b/cc1/tests/test066.c @@ -4,15 +4,13 @@ name: TEST066 description: Test cpp defined operator error: -test066.c:55: error: operator 'defined' requires an identifier -test066.c:55: error: expected ')' before '<EOF>' +test066.c:53: error: operator 'defined' requires an identifier +test066.c:53: error: expected ')' before '<EOF>' output: -V2 K #NC -V4 K #N9 -G5 I "x ( +G1 I "x ( #I0 ) -G7 I F "main +G3 I F "main { \ h #I0