[cfe-commits] r80593 - in /cfe/trunk/test/Preprocessor: non_fragile_feature.m non_fragile_feature1.m

David Chisnall csdavec at swan.ac.uk
Mon Aug 31 09:53:06 PDT 2009


Author: theraven
Date: Mon Aug 31 11:53:06 2009
New Revision: 80593

URL: http://llvm.org/viewvc/llvm-project?rev=80593&view=rev
Log:
Added test cases for presence and absence of __has_feature(objc_nonfragile_abi) with and without -fobjc-nonfragile-abi.


Added:
    cfe/trunk/test/Preprocessor/non_fragile_feature.m
      - copied, changed from r80437, cfe/trunk/test/Preprocessor/feature_tests.c
    cfe/trunk/test/Preprocessor/non_fragile_feature1.m
      - copied, changed from r80437, cfe/trunk/test/Preprocessor/feature_tests.c

Copied: cfe/trunk/test/Preprocessor/non_fragile_feature.m (from r80437, cfe/trunk/test/Preprocessor/feature_tests.c)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/non_fragile_feature.m?p2=cfe/trunk/test/Preprocessor/non_fragile_feature.m&p1=cfe/trunk/test/Preprocessor/feature_tests.c&r1=80437&r2=80593&rev=80593&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/feature_tests.c (original)
+++ cfe/trunk/test/Preprocessor/non_fragile_feature.m Mon Aug 31 11:53:06 2009
@@ -1,31 +1,8 @@
-// RUN: clang-cc %s --triple=i686-apple-darwin9 &&
-// RUN: clang-cc %s -E --triple=i686-apple-darwin9
+// RUN: clang-cc -fobjc-nonfragile-abi %s
 #ifndef __has_feature
 #error Should have __has_feature
 #endif
 
-
-#if __has_feature(something_we_dont_have)
-#error Bad
-#endif
-
-#if  !__has_builtin(__builtin_huge_val) || \
-     !__has_builtin(__builtin_shufflevector) || \
-     !__has_builtin(__builtin_trap) || \
-     !__has_feature(attribute_analyzer_noreturn) || \
-     !__has_feature(attribute_overloadable)
-#error Clang should have these
-#endif
-
-#if __has_builtin(__builtin_insanity)
-#error Clang should not have this
-#endif
-
-
-
-// Make sure we have x86 builtins only (forced with target triple).
-
-#if !__has_builtin(__builtin_ia32_emms) || \
-    __has_builtin(__builtin_altivec_abs_v4sf)
-#error Broken handling of target-specific builtins
+#if !__has_feature(objc_nonfragile_abi)
+#error Non-fragile ABI used for compilation but feature macro not set.
 #endif

Copied: cfe/trunk/test/Preprocessor/non_fragile_feature1.m (from r80437, cfe/trunk/test/Preprocessor/feature_tests.c)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/non_fragile_feature1.m?p2=cfe/trunk/test/Preprocessor/non_fragile_feature1.m&p1=cfe/trunk/test/Preprocessor/feature_tests.c&r1=80437&r2=80593&rev=80593&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/feature_tests.c (original)
+++ cfe/trunk/test/Preprocessor/non_fragile_feature1.m Mon Aug 31 11:53:06 2009
@@ -1,31 +1,8 @@
-// RUN: clang-cc %s --triple=i686-apple-darwin9 &&
-// RUN: clang-cc %s -E --triple=i686-apple-darwin9
+// RUN: clang-cc %s
 #ifndef __has_feature
 #error Should have __has_feature
 #endif
 
-
-#if __has_feature(something_we_dont_have)
-#error Bad
-#endif
-
-#if  !__has_builtin(__builtin_huge_val) || \
-     !__has_builtin(__builtin_shufflevector) || \
-     !__has_builtin(__builtin_trap) || \
-     !__has_feature(attribute_analyzer_noreturn) || \
-     !__has_feature(attribute_overloadable)
-#error Clang should have these
-#endif
-
-#if __has_builtin(__builtin_insanity)
-#error Clang should not have this
-#endif
-
-
-
-// Make sure we have x86 builtins only (forced with target triple).
-
-#if !__has_builtin(__builtin_ia32_emms) || \
-    __has_builtin(__builtin_altivec_abs_v4sf)
-#error Broken handling of target-specific builtins
+#if __has_feature(objc_nonfragile_abi)
+#error Non-fragile ABI not used for compilation but feature macro set.
 #endif





More information about the cfe-commits mailing list