| 1 |
// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s |
| 2 |
|
| 3 |
// CHECK: int x __attribute__((aligned(4))); |
| 4 |
int x __attribute__((aligned(4))); |
| 5 |
|
| 6 |
// CHECK: __declspec(align(4)) int y; |
| 7 |
__declspec(align(4)) int y; |
| 8 |
|
| 9 |
// CHECK: int foo() __attribute__((const)); |
| 10 |
int foo() __attribute__((const)); |
| 11 |
|
| 12 |
// CHECK: int bar() __attribute__((__const)); |
| 13 |
int bar() __attribute__((__const)); |
| 14 |
|
| 15 |
// FIXME: Print this with correct format. |
| 16 |
// CHECK: int foo1() __attribute__((noinline)) __attribute__((pure)); |
| 17 |
int foo1() __attribute__((noinline, pure)); |
| 18 |
|
| 19 |
// CHECK: typedef int Small1 __attribute__((mode(byte))); |
| 20 |
typedef int Small1 __attribute__((mode(byte))); |
| 21 |
|
| 22 |
// CHECK: int small __attribute__((mode(byte))); |
| 23 |
int small __attribute__((mode(byte))); |
| 24 |
|
| 25 |
// CHECK: int v __attribute__((visibility("hidden"))); |
| 26 |
int v __attribute__((visibility("hidden"))); |
| 27 |
|
| 28 |
// CHECK: char *PR24565() __attribute__((malloc)) |
| 29 |
char *PR24565() __attribute__((__malloc__)); |
| 30 |
|
| 31 |
void my_cleanup_func(char *); |
| 32 |
|
| 33 |
// using __attribute__(malloc()) with args is currently ignored by Clang |
| 34 |
// CHECK: char *PR52265_a() |
| 35 |
__attribute__((malloc(my_cleanup_func))) char *PR52265_a(); |
| 36 |
// CHECK: char *PR52265_b() |
| 37 |
__attribute__((malloc(my_cleanup_func, 1))) char *PR52265_b(); |
| 38 |
|
| 39 |
// CHECK: class __attribute__((consumable("unknown"))) AttrTester1 |
| 40 |
class __attribute__((consumable(unknown))) AttrTester1 { |
| 41 |
// CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed"))); |
| 42 |
void callableWhen() __attribute__((callable_when("unconsumed", "consumed"))); |
| 43 |
}; |
| 44 |
|
| 45 |
// CHECK: class __single_inheritance SingleInheritance; |
| 46 |
class __single_inheritance SingleInheritance; |
| 47 |
|
| 48 |
// CHECK: class __multiple_inheritance MultipleInheritance; |
| 49 |
class __multiple_inheritance MultipleInheritance; |
| 50 |
|
| 51 |
// CHECK: class __virtual_inheritance VirtualInheritance; |
| 52 |
class __virtual_inheritance VirtualInheritance; |
| 53 |
|
| 54 |
// CHECK: typedef double *aligned_double __attribute__((align_value(64))); |
| 55 |
typedef double * __attribute__((align_value(64))) aligned_double; |