Ir-gen the side-effect(s) when __builtin_expect is
constant-folded. // rdar://9330105
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130163 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/builtin-expect.c b/test/CodeGen/builtin-expect.c
index 8f02c4d..88479d9 100644
--- a/test/CodeGen/builtin-expect.c
+++ b/test/CodeGen/builtin-expect.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
int x;
int y(void);
@@ -9,3 +9,13 @@
foo ();
}
+// rdar://9330105
+void isigprocmask(void);
+long bar();
+
+int main() {
+ (void) __builtin_expect((isigprocmask(), 0), bar());
+}
+
+// CHECK: call void @isigprocmask()
+// CHECK: [[C:%.*]] = call i64 (...)* @bar()