OLD | NEW |
1 /* Check if ObjC class layout follows the ABI (informally) | 1 /* Check if ObjC class layout follows the ABI (informally) |
2 set in the past. ObjC structs must be laid out as if | 2 set in the past. ObjC structs must be laid out as if |
3 all ivars, including those inherited from superclasses, | 3 all ivars, including those inherited from superclasses, |
4 were defined at once (i.e., any padding introduced for | 4 were defined at once (i.e., any padding introduced for |
5 superclasses should be removed). */ | 5 superclasses should be removed). */ |
6 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */ | 6 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */ |
7 /* { dg-do run } */ | 7 /* { dg-do run } */ |
8 /* { dg-options "-Wpadded -Wabi" } */ | 8 /* { dg-options "-Wpadded -Wabi" } */ |
9 | 9 |
10 /* Leave blank lines here to keep warnings on the same lines. */ | 10 /* Leave blank lines here to keep warnings on the same lines. */ |
11 | 11 |
| 12 #include "../objc-obj-c++-shared/Object1.h" |
12 #include <objc/objc.h> | 13 #include <objc/objc.h> |
13 #include <objc/Object.h> | |
14 #include <stdlib.h> | 14 #include <stdlib.h> |
15 | 15 |
16 #define CHECK_IF(expr) if(!(expr)) abort() | 16 #define CHECK_IF(expr) if(!(expr)) abort() |
17 | 17 |
18 enum Enum { zero, one, two, three, four }; | 18 enum Enum { zero, one, two, three, four }; |
19 | 19 |
20 @interface Base: Object { | 20 @interface Base: Object { |
21 @public | 21 @public |
22 unsigned a: 2; | 22 unsigned a: 2; |
23 int b: 3; | 23 int b: 3; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 CHECK_IF(l->d == 31 && l_t->d == 31); | 108 CHECK_IF(l->d == 31 && l_t->d == 31); |
109 CHECK_IF(!l->e && !l_t->e); | 109 CHECK_IF(!l->e && !l_t->e); |
110 CHECK_IF(l->f == 15 && l_t->f == 15); | 110 CHECK_IF(l->f == 15 && l_t->f == 15); |
111 CHECK_IF(l->g == zero && l_t->g == zero); | 111 CHECK_IF(l->g == zero && l_t->g == zero); |
112 CHECK_IF(l->h == -2 && l_t->h == -2); | 112 CHECK_IF(l->h == -2 && l_t->h == -2); |
113 | 113 |
114 return 0; | 114 return 0; |
115 } | 115 } |
116 | 116 |
117 /* { dg-prune-output "In file included from" } Ignore this message. */ | 117 /* { dg-prune-output "In file included from" } Ignore this message. */ |
118 /* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */ | 118 /* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */ |
119 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */ | 119 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */ |
120 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */ | 120 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */ |
121 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */ | 121 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */ |
122 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 62 } */ | 122 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 62 } */ |
123 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 77 } */ | 123 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 77 } */ |
124 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 78 } */ | 124 /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 78 } */ |
OLD | NEW |