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

Side by Side Diff: tests_lit/llvm2ice_tests/unreachable.ll

Issue 945953002: Subzero: Translate the unreachable bitcode directly to ud2. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This tests the basic structure of the Unreachable instruction. 1 ; This tests the basic structure of the Unreachable instruction.
2 2
3 ; RUN: %p2i -i %s --assemble --disassemble -a -O2 --verbose none \ 3 ; RUN: %p2i -i %s --assemble --disassemble -a -O2 --verbose none \
4 ; RUN: | FileCheck %s 4 ; RUN: | FileCheck %s
5 ; RUN: %p2i -i %s --assemble --disassemble -a -Om1 --verbose none \ 5 ; RUN: %p2i -i %s --assemble --disassemble -a -Om1 --verbose none \
6 ; RUN: | FileCheck %s 6 ; RUN: | FileCheck %s
7 7
8 define internal i32 @divide(i32 %num, i32 %den) { 8 define internal i32 @divide(i32 %num, i32 %den) {
9 entry: 9 entry:
10 %cmp = icmp ne i32 %den, 0 10 %cmp = icmp ne i32 %den, 0
11 br i1 %cmp, label %return, label %abort 11 br i1 %cmp, label %return, label %abort
12 12
13 abort: ; preds = %entry 13 abort: ; preds = %entry
14 unreachable 14 unreachable
15 15
16 return: ; preds = %entry 16 return: ; preds = %entry
17 %div = sdiv i32 %num, %den 17 %div = sdiv i32 %num, %den
18 ret i32 %div 18 ret i32 %div
19 } 19 }
20 20
21 ; CHECK-LABEL: divide 21 ; CHECK-LABEL: divide
22 ; CHECK: cmp 22 ; CHECK: cmp
23 ; CHECK: call {{.*}} R_{{.*}} ice_unreachable 23 ; CHECK: ud2
24 ; CHECK: cdq 24 ; CHECK: cdq
25 ; CHECK: idiv 25 ; CHECK: idiv
26 ; CHECK: ret 26 ; CHECK: ret
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698