aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2014-03-05 19:04:42 -0800
committerDan Gohman <sunfish@mozilla.com>2014-03-05 19:04:42 -0800
commit0e03f9e9cecf388df2e3d19139be0a9faca63672 (patch)
treeceb80485c07e3ecc3444bae195b898c62878216c /test
parented9def75db9dbefd6b5a1f877d74fef8cc5fc720 (diff)
Disable the LowerExpectIntrinsic pass.
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/JS/expect-intrinsics.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/JS/expect-intrinsics.ll b/test/CodeGen/JS/expect-intrinsics.ll
new file mode 100644
index 0000000000..b061f52967
--- /dev/null
+++ b/test/CodeGen/JS/expect-intrinsics.ll
@@ -0,0 +1,26 @@
+; RUN: llc -march=js < %s | FileCheck %s
+
+; Handle the llvm.expect intrinsic.
+
+; CHECK: $expval = $x;
+; CHECK: $tobool = ($expval|0)!=(0);
+define void @foo(i32 %x) {
+entry:
+ %expval = call i32 @llvm.expect.i32(i32 %x, i32 0)
+ %tobool = icmp ne i32 %expval, 0
+ br i1 %tobool, label %if.then, label %if.end
+
+if.then:
+ call void @callee()
+ br label %if.end
+
+if.end:
+ ret void
+}
+
+; Function Attrs: nounwind readnone
+declare i32 @llvm.expect.i32(i32, i32) #0
+
+declare void @callee()
+
+attributes #0 = { nounwind readnone }