blob: b78a2517b18dfdba168dc86e9463156c05271c0c [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -triple=i686-apple-darwin9
2// RUN: %clang_cc1 %s -E -triple=i686-apple-darwin9
Chris Lattner148772a2009-06-13 07:13:28 +00003#ifndef __has_feature
4#error Should have __has_feature
5#endif
6
7
8#if __has_feature(something_we_dont_have)
9#error Bad
10#endif
11
12#if !__has_builtin(__builtin_huge_val) || \
13 !__has_builtin(__builtin_shufflevector) || \
14 !__has_builtin(__builtin_trap) || \
Richard Smithfafbf062012-04-11 17:55:32 +000015 !__has_builtin(__c11_atomic_init) || \
Chris Lattner148772a2009-06-13 07:13:28 +000016 !__has_feature(attribute_analyzer_noreturn) || \
17 !__has_feature(attribute_overloadable)
18#error Clang should have these
19#endif
20
21#if __has_builtin(__builtin_insanity)
22#error Clang should not have this
23#endif
24
Richard Smith5297d712012-02-25 10:41:10 +000025#if !__has_feature(__attribute_deprecated_with_message__)
26#error Feature name in double underscores does not work
27#endif
Chris Lattner148772a2009-06-13 07:13:28 +000028
29// Make sure we have x86 builtins only (forced with target triple).
30
31#if !__has_builtin(__builtin_ia32_emms) || \
32 __has_builtin(__builtin_altivec_abs_v4sf)
33#error Broken handling of target-specific builtins
34#endif