[hackers] [scc] [cc1] Add tests about incomplete arrays in test034.c || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 9 Aug 2016 17:12:25 +0200 (CEST)

commit c11910371793063297b672c0ed228e9599a7401e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Aug 9 17:01:43 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Aug 9 17:01:43 2016 +0200

    [cc1] Add tests about incomplete arrays in test034.c
    
    These tests are really interesting because they tests
    that declaration of arrays of incomplete type in the
    external scope are allowed and there are not problems
    related to the fact of redefinition of them with
    the complete type.

diff --git a/cc1/tests/test034.c b/cc1/tests/test034.c
index 6fc42f9..6802619 100644
--- a/cc1/tests/test034.c
+++ b/cc1/tests/test034.c
_AT_@ -2,28 +2,41 @@
 
 /*
 name: TEST034
-description: Basic test for incomplete structures
+description: Basic test for incomplete types
 error:
-test034.c:46: error: declared variable 'bar' of incomplete type
-test034.c:46: error: redeclaration of 'bar'
+test034.c:59: error: declared variable 'bar' of incomplete type
+test034.c:59: error: redeclaration of 'bar'
 output:
-X3 S2 "x
-X5 I F "foo
-G6 I F "main
+G2 V1 "v
+V3 I #N10
+G2 V3 "v
+Y4 V1 "p
+Y4 V3 "p
+X7 S6 "x
+X9 I F "foo
+G10 I F "main
 {
 \
-X7 S2 "x
- h X7 'P #P0 !I
+X11 S6 "x
+ h X11 'P #P0 !I
 }
-G5 I F "foo
+G9 I F "foo
 {
 \
- X3 M9 .I #I0 :I
- h X3 M9 .I
+ X7 M13 .I #I0 :I
+ h X7 M13 .I
 }
-X13 S11 "bar2
+X17 S15 "bar2
 */
 
+int v[];
+int v[10];
+static int p[];
+static int p[10];
+static int p[10];
+int v[10];
+int v[];
+
 extern struct X x;
 int foo();
 
Received on Tue Aug 09 2016 - 17:12:25 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2016 - 17:24:14 CEST