blob: d7ef42306bd39eca2cb0ee0824e7a7db2ae2a3b2 [file] [log] [blame]
Richard Smith0cdcc982013-01-29 01:24:26 +00001// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
Michael Han99315932013-01-24 16:46:58 +00002
Michael Hanaf02bbe2013-02-01 01:19:17 +00003// CHECK: int x __attribute__((aligned(4)));
Michael Han99315932013-01-24 16:46:58 +00004int x __attribute__((aligned(4)));
5
Richard Smith0cdcc982013-01-29 01:24:26 +00006// FIXME: Print this at a valid location for a __declspec attr.
Michael Hanaf02bbe2013-02-01 01:19:17 +00007// CHECK: int y __declspec(align(4));
Richard Smith0cdcc982013-01-29 01:24:26 +00008__declspec(align(4)) int y;
Michael Han99315932013-01-24 16:46:58 +00009
10// CHECK: void foo() __attribute__((const));
11void foo() __attribute__((const));
12
13// CHECK: void bar() __attribute__((__const));
14void bar() __attribute__((__const));
Michael Hanff37d942013-01-29 04:13:20 +000015
Michael Krusedc5ce722018-08-03 01:21:16 +000016// FIXME: Print this with correct format.
17// CHECK: void foo1() __attribute__((noinline)) __attribute__((pure));
Michael Hanff37d942013-01-29 04:13:20 +000018void foo1() __attribute__((noinline, pure));
Enea Zaffanellaa86d88c2013-06-20 12:46:19 +000019
20// CHECK: typedef int Small1 __attribute__((mode(byte)));
21typedef int Small1 __attribute__((mode(byte)));
22
23// CHECK: int small __attribute__((mode(byte)));
24int small __attribute__((mode(byte)));
Aaron Ballman25a2cb92014-09-15 15:14:13 +000025
26// CHECK: int v __attribute__((visibility("hidden")));
27int v __attribute__((visibility("hidden")));
28
David Majnemera94e7b62015-08-25 16:44:38 +000029// CHECK: char *PR24565() __attribute__((malloc))
30char *PR24565() __attribute__((__malloc__));
31
Aaron Ballman53885382014-09-15 16:45:30 +000032// CHECK: class __attribute__((consumable("unknown"))) AttrTester1
Aaron Ballman25a2cb92014-09-15 15:14:13 +000033class __attribute__((consumable(unknown))) AttrTester1 {
34 // CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
35 void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
36};
Joel E. Dennyefdb9be2018-05-16 15:18:30 +000037
38// CHECK: class __single_inheritance SingleInheritance;
39class __single_inheritance SingleInheritance;
40
41// CHECK: class __multiple_inheritance MultipleInheritance;
42class __multiple_inheritance MultipleInheritance;
43
44// CHECK: class __virtual_inheritance VirtualInheritance;
45class __virtual_inheritance VirtualInheritance;