Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1222)

Unified Diff: test/Transforms/NaCl/rewrite-flt-rounds.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/Transforms/NaCl/rewrite-flt-rounds.ll
diff --git a/test/Transforms/NaCl/rewrite-flt-rounds.ll b/test/Transforms/NaCl/rewrite-flt-rounds.ll
new file mode 100644
index 0000000000000000000000000000000000000000..cb1a7e4a99244950b461b9ab429e24d4572acbcf
--- /dev/null
+++ b/test/Transforms/NaCl/rewrite-flt-rounds.ll
@@ -0,0 +1,38 @@
+; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s
+; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s -check-prefix=CLEANED
+; Test the @llvm.flt.rounds part of the RewriteLLVMIntrinsics pass
+
+declare i32 @llvm.flt.rounds()
+
+; No declaration or definition of llvm.flt.rounds() should remain.
+; CLEANED-NOT: @llvm.flt.rounds
+
+define i32 @call_flt_rounds() {
+; CHECK: call_flt_rounds
+; CHECK-NEXT: ret i32 1
+ %val = call i32 @llvm.flt.rounds()
+ ret i32 %val
+}
+
+; A more complex example with a number of calls in several BBs.
+define i32 @multiple_calls(i64* %arg, i32 %num) {
+; CHECK: multiple_calls
+entryblock:
+; CHECK: entryblock
+ %v1 = call i32 @llvm.flt.rounds()
+ br label %block1
+block1:
+; CHECK: block1:
+; CHECK-NEXT: %v3 = add i32 1, 1
+ %v2 = call i32 @llvm.flt.rounds()
+ %v3 = add i32 %v2, %v1
+ br label %exitblock
+exitblock:
+; CHECK: exitblock:
+; CHECK-NEXT: %v4 = add i32 1, %v3
+; CHECK-NEXT: %v6 = add i32 1, %v4
+ %v4 = add i32 %v2, %v3
+ %v5 = call i32 @llvm.flt.rounds()
+ %v6 = add i32 %v5, %v4
+ ret i32 %v6
+}
« no previous file with comments | « test/Transforms/NaCl/rewrite-call-with-libfunc-argument.ll ('k') | test/Transforms/NaCl/rewrite-libcalls-wrong-signature.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698