summaryrefslogtreecommitdiff
path: root/clang/test/Lexer/has_feature_rtti.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Lexer/has_feature_rtti.cpp')
-rw-r--r--clang/test/Lexer/has_feature_rtti.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Lexer/has_feature_rtti.cpp b/clang/test/Lexer/has_feature_rtti.cpp
new file mode 100644
index 0000000..4bfeead
--- /dev/null
+++ b/clang/test/Lexer/has_feature_rtti.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-RTTI %s
+// RUN: %clang_cc1 -E -fno-rtti %s -o - | FileCheck --check-prefix=CHECK-NO-RTTI %s
+
+#if __has_feature(cxx_rtti)
+int foo();
+#else
+int bar();
+#endif
+
+// CHECK-RTTI: foo
+// CHECK-NO-RTTI: bar