[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / attr-print.cpp
blobfa8059fc8ab3604fdfce3b9b84d1dfbc2739113f
1 // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
3 // CHECK: int x __attribute__((aligned(4)));
4 int x __attribute__((aligned(4)));
6 // FIXME: Print this at a valid location for a __declspec attr.
7 // CHECK: int y __declspec(align(4));
8 __declspec(align(4)) int y;
10 // CHECK: void foo() __attribute__((const));
11 void foo() __attribute__((const));
13 // CHECK: void bar() __attribute__((__const));
14 void bar() __attribute__((__const));
16 // FIXME: Print this with correct format.
17 // CHECK: void foo1() __attribute__((noinline)) __attribute__((pure));
18 void foo1() __attribute__((noinline, pure));
20 // CHECK: typedef int Small1 __attribute__((mode(byte)));
21 typedef int Small1 __attribute__((mode(byte)));
23 // CHECK: int small __attribute__((mode(byte)));
24 int small __attribute__((mode(byte)));
26 // CHECK: int v __attribute__((visibility("hidden")));
27 int v __attribute__((visibility("hidden")));
29 // CHECK: char *PR24565() __attribute__((malloc))
30 char *PR24565() __attribute__((__malloc__));
32 // CHECK: class __attribute__((consumable("unknown"))) AttrTester1
33 class __attribute__((consumable(unknown))) AttrTester1 {
34 // CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
35 void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
38 // CHECK: class __single_inheritance SingleInheritance;
39 class __single_inheritance SingleInheritance;
41 // CHECK: class __multiple_inheritance MultipleInheritance;
42 class __multiple_inheritance MultipleInheritance;
44 // CHECK: class __virtual_inheritance VirtualInheritance;
45 class __virtual_inheritance VirtualInheritance;
47 // CHECK: typedef double *aligned_double __attribute__((align_value(64)));
48 typedef double * __attribute__((align_value(64))) aligned_double;