diff options
author | Anders Carlsson <andersca@mac.com> | 2010-10-20 02:31:43 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-10-20 02:31:43 +0000 |
commit | 274a70ed7f4315c83273173fce4c3b0e097958d6 (patch) | |
tree | fccdd5042be19eff3d1c109477cdf047af8c70b8 /clang/test/Lexer | |
parent | 23c8341c3dfbb9b453cc3857eabc2405207887cf (diff) | |
download | bcm5719-llvm-274a70ed7f4315c83273173fce4c3b0e097958d6.tar.gz bcm5719-llvm-274a70ed7f4315c83273173fce4c3b0e097958d6.zip |
Add a __has_attribute macro that works much like __has_feature and __has_builtin.
llvm-svn: 116906
Diffstat (limited to 'clang/test/Lexer')
-rw-r--r-- | clang/test/Lexer/has_attribute.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Lexer/has_attribute.cpp b/clang/test/Lexer/has_attribute.cpp new file mode 100644 index 00000000000..9a58a3013fb --- /dev/null +++ b/clang/test/Lexer/has_attribute.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -E %s -o - | FileCheck %s + +// CHECK: always_inline +#if __has_attribute(always_inline) +int always_inline(); +#endif + +// CHECK: no_dummy_attribute +#if !__has_attribute(dummy_attribute) +int no_dummy_attribute(); +#endif + |