Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s |
| 2 | // FIXME: align attribute print |
| 3 | |
| 4 | // CHECK: int x __attribute__((aligned(4, 0))); |
| 5 | int x __attribute__((aligned(4))); |
| 6 | |
| 7 | // CHECK: int y __attribute__((align(4, 0))); |
| 8 | int y __attribute__((align(4))); |
| 9 | |
| 10 | // CHECK: gnu::aligned(4, 0)]]; |
| 11 | int z [[gnu::aligned(4)]]; |
| 12 | |
| 13 | // CHECK: __attribute__((deprecated("warning"))); |
| 14 | int a __attribute__((deprecated("warning"))); |
| 15 | |
| 16 | // CHECK: gnu::deprecated("warning")]]; |
| 17 | int b [[gnu::deprecated("warning")]]; |
| 18 | |
| 19 | // CHECK: void foo() __attribute__((const)); |
| 20 | void foo() __attribute__((const)); |
| 21 | |
| 22 | // CHECK: void bar() __attribute__((__const)); |
| 23 | void bar() __attribute__((__const)); |
| 24 | |
| 25 | // CHECK: int f1() __attribute__((warn_unused_result)); |
| 26 | int f1() __attribute__((warn_unused_result)); |
| 27 | |
| 28 | // CHECK: clang::warn_unused_result]]; |
| 29 | int f2 [[clang::warn_unused_result]] (); |
| 30 | |
| 31 | // CHECK: gnu::warn_unused_result]]; |
| 32 | int f3 [[gnu::warn_unused_result]] (); |
| 33 | |
| 34 | // FIXME: ast-print need to print C++11 |
| 35 | // attribute after function declare-id. |
| 36 | // CHECK: noreturn]]; |
| 37 | void f4 [[noreturn]] (); |
| 38 | |
| 39 | // CHECK: std::noreturn]]; |
| 40 | void f5 [[std::noreturn]] (); |
| 41 | |
| 42 | // CHECK: __attribute__((gnu_inline)); |
| 43 | inline void f6() __attribute__((gnu_inline)); |
| 44 | |
| 45 | // CHECK: gnu::gnu_inline]]; |
| 46 | inline void f7 [[gnu::gnu_inline]] (); |
| 47 | |
| 48 | // arguments printing |
| 49 | // CHECK: __attribute__((format("printf", 2, 3))); |
| 50 | void f8 (void *, const char *, ...) __attribute__ ((format (printf, 2, 3))); |