56 lines · cpp
1// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s2 3// CHECK: int x __attribute__((aligned(4)));4int 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));10int foo() __attribute__((const));11 12// CHECK: int bar() __attribute__((__const));13int bar() __attribute__((__const));14 15// FIXME: Print this with correct format.16// CHECK: int foo1() __attribute__((noinline)) __attribute__((pure));17int foo1() __attribute__((noinline, pure));18 19// CHECK: typedef int Small1 __attribute__((mode(byte)));20typedef int Small1 __attribute__((mode(byte)));21 22// CHECK: int small __attribute__((mode(byte)));23int small __attribute__((mode(byte)));24 25// CHECK: int v __attribute__((visibility("hidden")));26int v __attribute__((visibility("hidden")));27 28// CHECK: char *PR24565() __attribute__((malloc))29char *PR24565() __attribute__((__malloc__));30 31void my_cleanup_func(char *);32 33// using __attribute__(malloc()) with args is currently ignored by Clang34// 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"))) AttrTester140class __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;46class __single_inheritance SingleInheritance;47 48// CHECK: class __multiple_inheritance MultipleInheritance;49class __multiple_inheritance MultipleInheritance;50 51// CHECK: class __virtual_inheritance VirtualInheritance;52class __virtual_inheritance VirtualInheritance;53 54// CHECK: typedef double *aligned_double __attribute__((align_value(64)));55typedef double * __attribute__((align_value(64))) aligned_double;56