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

Side by Side Diff: test/NaCl/Bitcode/forward-ref-decl.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/Bitcode/flags.ll ('k') | test/NaCl/Bitcode/forward-ref-pointer-intrinsic.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: llvm-as < %s | pnacl-freeze | pnacl-bcanalyzer -dump-records \
2 ; RUN: | FileCheck %s
3
4 ; Test that FORWARDTYPEREF declarations are emitted in the correct
5 ; places. These are emitted for forward value references inside
6 ; functions.
7
8 define external void @_start(i32 %arg) {
9 ; CHECK: <FUNCTION_BLOCK
10
11 br label %bb1
12 ; CHECK: <INST_BR
13
14 bb2:
15 ; This instruction contains two forward references, because %x and
16 ; %y are defined later in the function.
17 add i32 %forward1, %forward2
18 ; CHECK-NEXT: <FORWARDTYPEREF
19 ; CHECK-NEXT: <FORWARDTYPEREF
20 ; CHECK-NEXT: <INST_BINOP
21
22 ; The FORWARDTYPEREF declaration should only be emitted once per
23 ; value, so the following references will not emit more of them.
24 add i32 %forward1, %forward2
25 ; CHECK-NEXT: <INST_BINOP
26
27 ; Test another case of a forward reference.
28 call void @_start(i32 %forward3)
29 ; CHECK-NEXT: <FORWARDTYPEREF
30 ; CHECK-NEXT: <INST_CALL
31
32 ; Test that FORWARDTYPEREF is generated for phi nodes (since phi
33 ; node operands are a special case in the writer).
34 br label %bb3
35 bb3:
36 phi i32 [ %forward4, %bb2 ]
37 ; CHECK-NEXT: <INST_BR
38 ; CHECK-NEXT: <FORWARDTYPEREF
39 ; CHECK-NEXT: <INST_PHI
40
41 ; Test that FORWARDTYPEREF is generated for switch instructions
42 ; (since switch condition operands are a special case in the
43 ; writer).
44 switch i32 %forward5, label %bb4 [i32 0, label %bb4]
45 bb4:
46 ; CHECK-NEXT: <FORWARDTYPEREF
47 ; CHECK-NEXT: <INST_SWITCH
48
49 ret void
50 ; CHECK-NEXT: <INST_RET/>
51
52 bb1:
53 %forward1 = add i32 %arg, 100
54 %forward2 = add i32 %arg, 200
55 %forward3 = add i32 %arg, 300
56 %forward4 = add i32 %arg, 400
57 %forward5 = add i32 %arg, 500
58 br label %bb2
59 }
OLDNEW
« no previous file with comments | « test/NaCl/Bitcode/flags.ll ('k') | test/NaCl/Bitcode/forward-ref-pointer-intrinsic.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698