• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2// RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-rw.cpp
3
4@interface NSCheapMutableString {
5@private
6    struct S s0;
7    union {
8        char *fat;
9        unsigned char *thin;
10    } contents;
11
12    struct {
13        unsigned int isFat:1;
14        unsigned int freeWhenDone:1;
15        unsigned int refs:30;
16    } flags;
17
18    struct S {
19        int iS1;
20        double dS1;
21    } others;
22
23    union U {
24      int iU1;
25      double dU1;
26    } u_others;
27
28   enum {
29    One, Two
30   } E1;
31
32   enum e {
33    Yes = 1,
34    No = 0
35   } BoOl;
36
37   struct S s1;
38
39   enum e E2;
40
41    union {
42        char *fat;
43        unsigned char *thin;
44    } Last_contents;
45
46    struct {
47        unsigned int isFat:1;
48        unsigned int freeWhenDone:1;
49        unsigned int refs:30;
50    } Last_flags;
51}
52@end
53
54@interface III {
55@private
56    struct S s0;
57
58    union {
59        char *fat;
60        unsigned char *thin;
61    } contents;
62
63    struct {
64        unsigned int isFat:1;
65        unsigned int freeWhenDone:1;
66        unsigned int refs:30;
67    } flags;
68
69   enum {
70    One1 = 1000, Two1, Three1
71   } E1;
72
73   struct S s1;
74
75   enum e E2;
76
77    union {
78        char *fat;
79        unsigned char *thin;
80    } Last_contents;
81
82    struct {
83        unsigned int isFat:1;
84        unsigned int freeWhenDone:1;
85        unsigned int refs:30;
86    } Last_flags;
87}
88@end
89
90enum OUTSIDE {
91  yes
92};
93
94@interface MoreEnumTests {
95@private
96    enum INSIDE {
97        no
98    } others;
99
100    enum OUTSIDE meetoo;
101
102    enum {
103       one,
104       two
105    } eu;
106}
107@end
108
109@interface I {
110    enum INSIDE I1;
111    enum OUTSIDE  I2;
112    enum ALSO_INSIDE {
113      maybe
114    } I3;
115
116   enum ALSO_INSIDE I4;
117
118    enum {
119       three,
120       four
121    } I5;
122}
123@end
124
125