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

Side by Side Diff: test/NaCl/ARM/call-return-sandboxing1.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 unified diff | Download patch
« no previous file with comments | « test/NaCl/ARM/bx-sandboxing.ll ('k') | test/NaCl/ARM/divrem-guards.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; RUN: pnacl-llc -mtriple=armv7-unknown-nacl -filetype=obj %s -o - \
2 ; RUN: | llvm-objdump -disassemble -triple armv7 - | FileCheck %s
3
4 define i32 @foo(i32 %aa, i32 %bb) nounwind {
5 entry:
6 %aa.addr = alloca i32, align 4
7 %bb.addr = alloca i32, align 4
8 %cc = alloca i32, align 4
9 %dd = alloca i32, align 4
10 store i32 %aa, i32* %aa.addr, align 4
11 store i32 %bb, i32* %bb.addr, align 4
12 %0 = load i32* %aa.addr, align 4
13 %1 = load i32* %bb.addr, align 4
14 %mul = mul nsw i32 %0, %1
15 store i32 %mul, i32* %cc, align 4
16 %sub = sub nsw i32 %mul, %1
17 store i32 %sub, i32* %dd, align 4
18 %2 = load i32* %dd, align 4
19 ret i32 %2
20
21 ; This checks two things:
22 ; 1. bx lr is sandboxed by prepending a bic
23 ; 2. The bic/bx pair don't straddle a 16-byte bundle boundary, hence the nop
24 ; CHECK: nop
25 ; CHECK-NEXT: {{.*}}0:{{.*}}bic lr, lr, #3221225487
26 ; CHECK-NEXT: bx lr
27
28 }
29
30 define i32 @bar(i32 %aa, i32 %bb) nounwind {
31 entry:
32
33 ; Check that the function start is padded with nops to start at a bundle
34 ; boundary
35 ; CHECK: nop
36 ; CHECK-LABEL: bar:
37 ; CHECK-NEXT: {{.*}}0:{{.*}}push
38
39 %aa.addr = alloca i32, align 4
40 %bb.addr = alloca i32, align 4
41 store i32 %aa, i32* %aa.addr, align 4
42 store i32 %bb, i32* %bb.addr, align 4
43 %0 = load i32* %aa.addr, align 4
44 %mul = mul nsw i32 %0, 19
45 %call = call i32 @foo(i32 %mul, i32 7)
46
47 ; Check that the call is padded to be at the end of a bundle
48 ; CHECK: {{.*}}8:{{.*}}nop
49 ; CHECK-NEXT: {{.*}}c:{{.*}}bl
50
51 %1 = load i32* %bb.addr, align 4
52 %mul1 = mul nsw i32 %1, 31
53 %2 = load i32* %bb.addr, align 4
54 %div = sdiv i32 %2, 7
55 %add = add nsw i32 %div, 191
56 %call2 = call i32 @foo(i32 %mul1, i32 %add)
57
58 ; Check that the call is padded to be at the end of a bundle
59 ; CHECK: {{.*}}8:{{.*}}nop
60 ; CHECK-NEXT: {{.*}}c:{{.*}}bl
61
62 %add3 = add nsw i32 %call, %call2
63 ret i32 %add3
64 }
65
OLDNEW
« no previous file with comments | « test/NaCl/ARM/bx-sandboxing.ll ('k') | test/NaCl/ARM/divrem-guards.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698