]> granicus.if.org Git - clang/commitdiff
Remove the part of test/Sema/pragma-pack-2.c that has irregular "#pragma pack"s.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 10 Mar 2012 03:20:52 +0000 (03:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 10 Mar 2012 03:20:52 +0000 (03:20 +0000)
Before r151307 this part worked without compiler errors but now it only verifies
that our handling of irregular pragmas is broken compared to gcc, it has no
practical usefulness; it creates invalid structs that cannot be used for 'offsetof' testing.

If we later decide to handle irregular pragmas without compiler errors we can
put back this part.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152480 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/pragma-pack-2.c

index 10968fa8bd2329eaaaa9ecb9d606029e256ea24b..4a4c202c71addcc3eee251c2842c6a5b87655ff2 100644 (file)
@@ -19,52 +19,6 @@ struct s1 {
 extern int a1[offsetof(struct s1, f1) == 2 ? 1 : -1];
 #pragma pack(pop)
 
-// Test scope of definition
-
-#pragma pack(push, 2)
-struct s2_0 { // expected-error {{expected ';'}}
-#pragma pack(pop) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-  char f0;
-  int  f1;
-};
-extern int a2_0[offsetof(struct s2_0, f1) == 2 ? 1 : -1];
-
-struct s2_1 {
-  char f0; // expected-error {{expected ';'}}
-#pragma pack(push, 2) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-  int  f1; // expected-error {{expected ';'}}
-#pragma pack(pop) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-};
-extern int a2_1[offsetof(struct s2_1, f1) == 4 ? 1 : -1];
-
-struct s2_2 {
-  char f0;
-  int  f1; // expected-error {{expected ';'}}
-#pragma pack(push, 2) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-};
-#pragma pack(pop)
-extern int a2_2[offsetof(struct s2_2, f1) == 4 ? 1 : -1];
-
-struct s2_3 {
-  char f0; // expected-error {{expected ';'}}
-#pragma pack(push, 2) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-  struct s2_3_0 { 
-#pragma pack(pop)
-    int f0; 
-  } f1;
-};
-extern int a2_3[offsetof(struct s2_3, f1) == 2 ? 1 : -1];
-
-struct s2_4 {
-  char f0;
-  struct s2_4_0 { 
-    int f0; // expected-error {{expected ';'}}
-#pragma pack(push, 2) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-  } f1; // expected-error {{expected ';'}}
-#pragma pack(pop) // expected-error {{type name}} expected-error {{member name}} expected-warning {{type specifier}}
-};
-extern int a2_4[offsetof(struct s2_4, f1) == 4 ? 1 : -1];
-
 #pragma pack(1)
 struct s3_0 {
   char f0;