Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 2 | |
Michael Han | af02bbe | 2013-02-01 01:19:17 +0000 | [diff] [blame] | 3 | // CHECK: int x __attribute__((aligned(4))); |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 4 | int x __attribute__((aligned(4))); |
| 5 | |
Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 6 | // FIXME: Print this at a valid location for a __declspec attr. |
Michael Han | af02bbe | 2013-02-01 01:19:17 +0000 | [diff] [blame] | 7 | // CHECK: int y __declspec(align(4)); |
Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 8 | __declspec(align(4)) int y; |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 9 | |
| 10 | // CHECK: void foo() __attribute__((const)); |
| 11 | void foo() __attribute__((const)); |
| 12 | |
| 13 | // CHECK: void bar() __attribute__((__const)); |
| 14 | void bar() __attribute__((__const)); |
Michael Han | ff37d94 | 2013-01-29 04:13:20 +0000 | [diff] [blame] | 15 | |
| 16 | // FIXME: Print this with correct format and order. |
| 17 | // CHECK: void foo1() __attribute__((pure)) __attribute__((noinline)); |
| 18 | void foo1() __attribute__((noinline, pure)); |
Enea Zaffanella | a86d88c | 2013-06-20 12:46:19 +0000 | [diff] [blame] | 19 | |
| 20 | // CHECK: typedef int Small1 __attribute__((mode(byte))); |
| 21 | typedef int Small1 __attribute__((mode(byte))); |
| 22 | |
| 23 | // CHECK: int small __attribute__((mode(byte))); |
| 24 | int small __attribute__((mode(byte))); |
Aaron Ballman | 25a2cb9 | 2014-09-15 15:14:13 +0000 | [diff] [blame] | 25 | |
| 26 | // CHECK: int v __attribute__((visibility("hidden"))); |
| 27 | int v __attribute__((visibility("hidden"))); |
| 28 | |
David Majnemer | a94e7b6 | 2015-08-25 16:44:38 +0000 | [diff] [blame] | 29 | // CHECK: char *PR24565() __attribute__((malloc)) |
| 30 | char *PR24565() __attribute__((__malloc__)); |
| 31 | |
Aaron Ballman | 5388538 | 2014-09-15 16:45:30 +0000 | [diff] [blame] | 32 | // CHECK: class __attribute__((consumable("unknown"))) AttrTester1 |
Aaron Ballman | 25a2cb9 | 2014-09-15 15:14:13 +0000 | [diff] [blame] | 33 | class __attribute__((consumable(unknown))) AttrTester1 { |
| 34 | // CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed"))); |
| 35 | void callableWhen() __attribute__((callable_when("unconsumed", "consumed"))); |
| 36 | }; |