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

Unified Diff: tests_lit/llvm2ice_tests/adv-switch-opt.ll

Issue 1247833003: Handle UINT64_MAX edge case in switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/IceSwitchLowering.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/adv-switch-opt.ll
diff --git a/tests_lit/llvm2ice_tests/adv-switch-opt.ll b/tests_lit/llvm2ice_tests/adv-switch-opt.ll
index 1d109315987bf1b64423fd4b006b9c27c5689e31..bc1640fd3e4cad4a3382199f8780514af65a3f62 100644
--- a/tests_lit/llvm2ice_tests/adv-switch-opt.ll
+++ b/tests_lit/llvm2ice_tests/adv-switch-opt.ll
@@ -188,3 +188,31 @@ return:
; CHECK-NEXT: jne
; CHECK-NEXT: cmp {{.*}},0x12
; CHECK-NEXT: je
+
+; Test for correct 64-bit jump table with UINT64_MAX as one of the values.
+; TODO(ascull): this should generate a jump table
+define internal i32 @testJumpTable64(i64 %a) {
+entry:
+ switch i64 %a, label %sw.default [
+ i64 18446744073709551610, label %return
+ i64 18446744073709551612, label %sw.bb1
+ i64 18446744073709551613, label %sw.bb2
+ i64 18446744073709551615, label %sw.bb3
jvoung (off chromium) 2015/07/23 21:26:34 I think technically you could say "-1" also, if th
+ ]
+
+sw.bb1:
+ br label %return
+
+sw.bb2:
+ br label %return
+
+sw.bb3:
+ br label %return
+
+sw.default:
+ br label %return
+
+return:
+ %retval.0 = phi i32 [ 5, %sw.default ], [ 4, %sw.bb3 ], [ 3, %sw.bb2 ], [ 2, %sw.bb1 ], [ 1, %entry ]
+ ret i32 %retval.0
+}
jvoung (off chromium) 2015/07/23 21:26:34 Maybe move the "TODO" to the bottom here, add the
« no previous file with comments | « src/IceSwitchLowering.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698