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

Side by Side Diff: test/NaCl/Bitcode/pnacl-bcdis/call.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 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/Bitcode/pnacl-bcdis/br.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/casts.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 ; Test call instructions
2
3 ; RUN: llvm-as < %s | pnacl-freeze | pnacl-bccompress --remove-abbreviations \
4 ; RUN: | pnacl-bcdis | FileCheck %s
5
6 ; CHECK: {{.*}}| 3: <7, 32> | @t0 = i32;
7 ; CHECK-NEXT: {{.*}}| 3: <2> | @t1 = void;
8 ; CHECK-NEXT: {{.*}}| 3: <3> | @t2 = float;
9
10
11 ; Test simple calls
12 define void @foo(i32 %p0) {
13
14 ; CHECK: | | %b0:
15
16 %v0 = call i32 @bar(i32 %p0, i32 1)
17
18 ; CHECK-NEXT: {{.*}}| 3: <34, 0, 6, 2, 1> | %v0 = call i32
19 ; CHECK-NEXT: | | @f1(i32 %p0, i32 % c0);
20
21 %v1 = call float @bam(i32 %p0)
22
23 ; CHECK-NEXT: {{.*}}| 3: <34, 0, 6, 3> | %v1 = call float @f2(i 32 %p0);
24
25 call void @huh()
26 ret void
27
28 ; CHECK-NEXT: {{.*}}| 3: <34, 0, 6> | call void @f3();
29 ; CHECK-NEXT: {{.*}}| 3: <10> | ret void;
30
31 }
32
33 define i32 @bar(i32 %p0, i32 %p1) {
34
35 ; CHECK: | | %b0:
36
37 %v0 = add i32 %p0, %p1
38 ret i32 %v0
39 }
40
41 define float @bam(i32 %p0) {
42
43 ; CHECK: | | %b0:
44
45 %v0 = sitofp i32 %p0 to float
46 ret float %v0
47 }
48
49 define void @huh() {
50
51 ; CHECK: | | %b0:
52
53 ret void
54 }
55
56
57 ; Test indirect calls
58 define void @IndirectTests(i32 %p0, i32 %p1) {
59
60 ; CHECK: | | %b0:
61
62 ; Simulates indirect call to @foo
63 %v0 = inttoptr i32 %p0 to void (i32)*
64 call void %v0(i32 %p1)
65
66 ; CHECK-NEXT: {{.*}}| 3: <44, 0, 3, 1, 2> | call void %p0(i32 %p1) ;
67
68 ; Simulates indirect call to @bar
69 %v1 = inttoptr i32 %p0 to i32 (i32, i32)*
70 %v2 = call i32 %v1(i32 %p1, i32 1)
71
72 ; CHECK-NEXT: {{.*}}| 3: <44, 0, 3, 0, 2, 1> | %v0 = call i32
73 ; CHECK-NEXT: | | %p0(i32 %p1, i32 % c0);
74
75 ; Simulates indirect call to @bam
76 %v3 = inttoptr i32 %p0 to float (i32)*
77 %v4 = call float %v3(i32 %p1)
78
79 ; CHECK-NEXT: {{.*}}| 3: <44, 0, 4, 2, 3> | %v1 = call float %p0(i 32 %p1);
80
81 ; Simulates indirect call to @huh
82 %v5 = inttoptr i32 %p0 to void ()*
83 call void %v5()
84 ret void
85
86 ; CHECK-NEXT: {{.*}}| 3: <44, 0, 5, 1> | call void %p0();
87 ; CHECK-NEXT: {{.*}}| 3: <10> | ret void;
88
89 }
90
OLDNEW
« no previous file with comments | « test/NaCl/Bitcode/pnacl-bcdis/br.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/casts.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698