aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-03 01:17:43 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-03 01:17:43 +0000
commit107b4cae9be7dc59315e28f65b555cb2bd5f4574 (patch)
tree6e6d43cce69e9387f5440a9cfabbf9820dcec79c
parent848001c0cdddc05b7fd71251e1b635c0af24896d (diff)
Add FileCheck test for '__has_feature(rtti)'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90373 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Lexer/has_feature_rtti.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Lexer/has_feature_rtti.cpp b/test/Lexer/has_feature_rtti.cpp
new file mode 100644
index 0000000000..05bbd8860f
--- /dev/null
+++ b/test/Lexer/has_feature_rtti.cpp
@@ -0,0 +1,11 @@
+// RUN: clang -E -frtti %s -o - | FileCheck --check-prefix=CHECK-RTTI %s
+// RUN: clang -E -fno-rtti %s -o - | FileCheck --check-prefix=CHECK-NO-RTTI %s
+
+#if __has_feature(rtti)
+int foo();
+#else
+int bar();
+#endif
+
+// CHECK-RTTI: foo
+// CHECK-NO-RTTI: bar