blob: 711cf671cfea832b45bc1bcabe6a712a8058cb8e [file] [log] [blame]
Jean-Daniel Dupas9a0b7052012-03-01 17:45:53 +00001// RUN: %clang_cc1 -E %s -o - | FileCheck %s
2
3// CHECK: always_inline
4#if __has_attribute(always_inline)
5int always_inline();
Jean-Daniel Dupas8a5e7fd2012-03-01 14:53:16 +00006#endif
7
Jean-Daniel Dupas9a0b7052012-03-01 17:45:53 +00008// CHECK: __always_inline__
9#if __has_attribute(__always_inline__)
10int __always_inline__();
Jean-Daniel Dupas8a5e7fd2012-03-01 14:53:16 +000011#endif
12
Jean-Daniel Dupas9a0b7052012-03-01 17:45:53 +000013// CHECK: no_dummy_attribute
14#if !__has_attribute(dummy_attribute)
15int no_dummy_attribute();
16#endif
17
18// CHECK: has_has_attribute
19#ifdef __has_attribute
20int has_has_attribute();
21#endif
22
23// CHECK: has_something_we_dont_have
24#if !__has_attribute(something_we_dont_have)
25int has_something_we_dont_have();
Jean-Daniel Dupas8a5e7fd2012-03-01 14:53:16 +000026#endif
Fariborz Jahanian10caec22012-08-13 21:15:02 +000027
28// rdar://10253857
29#if __has_attribute(__const)
30 int fn3() __attribute__ ((__const));
31#endif
32
33#if __has_attribute(const)
34 static int constFunction() __attribute__((const));
35#endif
36