| 1 |
// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-gnu -verify %s |
| 2 |
|
| 3 |
struct { |
| 4 |
int a; |
| 5 |
} |
| 6 |
// expected-note@+1 {{conflicting attribute is here}} |
| 7 |
__attribute__((gcc_struct)) |
| 8 |
// expected-error@+1 {{'ms_struct' and 'gcc_struct' attributes are not compatible}} |
| 9 |
__attribute__((ms_struct)) |
| 10 |
t1; |
| 11 |
|
| 12 |
struct { |
| 13 |
int a; |
| 14 |
} |
| 15 |
// expected-note@+1 {{conflicting attribute is here}} |
| 16 |
__attribute__((ms_struct)) |
| 17 |
// expected-error@+1 {{'gcc_struct' and 'ms_struct' attributes are not compatible}} |
| 18 |
__attribute__((gcc_struct)) |
| 19 |
t2; |
| 20 |
|
| 21 |
#pragma ms_struct on |
| 22 |
struct { |
| 23 |
int a; |
| 24 |
} |
| 25 |
// No diagnostic for an attribute, unambiguously overriding the pragma. |
| 26 |
__attribute__((gcc_struct)) |
| 27 |
t3; |
| 28 |
|
| 29 |
struct { |
| 30 |
int a; |
| 31 |
} |
| 32 |
// expected-note@+1 {{conflicting attribute is here}} |
| 33 |
__attribute__((ms_struct)) |
| 34 |
// expected-error@+1 {{'gcc_struct' and 'ms_struct' attributes are not compatible}} |
| 35 |
__attribute__((gcc_struct)) |
| 36 |
t4; |
| 37 |
#pragma ms_struct off |