[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / Sema / MicrosoftExtensions.c
blob0ef72855684d9d7789b57606e861159d5604b5a1
1 // RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
4 struct A
6 int a[]; /* expected-warning {{flexible array member 'a' in otherwise empty struct is a Microsoft extension}} */
7 };
9 struct C {
10 int l;
11 union {
12 int c1[]; /* expected-warning {{flexible array member 'c1' in a union is a Microsoft extension}} */
13 char c2[]; /* expected-warning {{flexible array member 'c2' in a union is a Microsoft extension}} */
18 struct D {
19 int l;
20 int D[];
24 enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
25 enum ENUM1 var1 = 3;
26 enum ENUM1* var2 = 0;
29 enum ENUM2 {
30 ENUM2_a = (enum ENUM2) 4,
31 ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
32 ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
38 typedef struct notnested {
39 long bad1;
40 long bad2;
41 } NOTNESTED;
44 typedef struct nested1 {
45 long a;
46 struct notnested var1;
47 NOTNESTED var2;
48 } NESTED1;
50 struct nested2 {
51 long b;
52 NESTED1; // expected-warning {{anonymous structs are a Microsoft extension}}
55 struct test {
56 int c;
57 struct nested2; // expected-warning {{anonymous structs are a Microsoft extension}}
60 void foo()
62 struct test var;
63 var.a;
64 var.b;
65 var.c;
66 var.bad1; // expected-error {{no member named 'bad1' in 'struct test'}}
67 var.bad2; // expected-error {{no member named 'bad2' in 'struct test'}}