summaryrefslogtreecommitdiff
path: root/test/CodeGen/builtin-unpredictable.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/builtin-unpredictable.c')
-rw-r--r--test/CodeGen/builtin-unpredictable.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/CodeGen/builtin-unpredictable.c b/test/CodeGen/builtin-unpredictable.c
index 30709b0cac68a..bdd62e972b058 100644
--- a/test/CodeGen/builtin-unpredictable.c
+++ b/test/CodeGen/builtin-unpredictable.c
@@ -1,10 +1,15 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-llvm-passes -o - %s -O1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-llvm-passes -o - %s -O1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-llvm-passes -o - -x c++ %s -O1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O0 | FileCheck %s --check-prefix=CHECK_O0
// When optimizing, the builtin should be converted to metadata.
// When not optimizing, there should be no metadata created for the builtin.
// In both cases, the builtin should be removed from the code.
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void foo();
void branch(int x) {
// CHECK-LABEL: define void @branch(
@@ -42,5 +47,10 @@ int unpredictable_switch(int x) {
return 0;
}
+#ifdef __cplusplus
+}
+#endif
+
+
// CHECK: [[METADATA]] = !{}