blob: be9c62d780849afe8527713da3a74dea6ef3841b [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) || \
15 !__has_feature(attribute_analyzer_noreturn) || \
16 !__has_feature(attribute_overloadable)
17#error Clang should have these
18#endif
19
20#if __has_builtin(__builtin_insanity)
21#error Clang should not have this
22#endif
23
Richard Smith5297d712012-02-25 10:41:10 +000024#if !__has_feature(__attribute_deprecated_with_message__)
25#error Feature name in double underscores does not work
26#endif
Chris Lattner148772a2009-06-13 07:13:28 +000027
28// Make sure we have x86 builtins only (forced with target triple).
29
30#if !__has_builtin(__builtin_ia32_emms) || \
31 __has_builtin(__builtin_altivec_abs_v4sf)
32#error Broken handling of target-specific builtins
33#endif