~ubuntu-branches/ubuntu/saucy/emscripten/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/cases/indirectbrphi.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; ModuleID = '/tmp/tmpj4LoEu/src.cpp.o.bc'
 
2
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
 
3
target triple = "i386-pc-linux-gnu"
 
4
 
 
5
@_ZZ4mainE5addrs = private unnamed_addr constant [2 x i8*] [i8* blockaddress(@main, %14), i8* blockaddress(@main, %19)], align 4
 
6
@.str = private unnamed_addr constant [8 x i8] c"bad %d\0A\00", align 1
 
7
@.str1 = private unnamed_addr constant [9 x i8] c"good %d\0A\00", align 1
 
8
 
 
9
define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
 
10
  %1 = add i32 %argc, 12
 
11
  %2 = mul i32 %1, %argc
 
12
  %3 = icmp sgt i32 %2, 0
 
13
  br i1 %3, label %.lr.ph, label %8
 
14
 
 
15
.lr.ph:                                           ; preds = %.lr.ph, %0
 
16
  %which.010 = phi i32 [ %6, %.lr.ph ], [ 0, %0 ]
 
17
  %x.09 = phi i32 [ %7, %.lr.ph ], [ 0, %0 ]
 
18
  %4 = mul nsw i32 %x.09, %x.09
 
19
  %5 = add nsw i32 %which.010, %4
 
20
  %6 = srem i32 %5, 7
 
21
  %7 = add nsw i32 %x.09, 1
 
22
  %exitcond = icmp eq i32 %7, %2
 
23
  br i1 %exitcond, label %._crit_edge, label %.lr.ph
 
24
 
 
25
._crit_edge:                                      ; preds = %.lr.ph
 
26
  %phitmp = srem i32 %6, 2
 
27
  %phitmp11 = add i32 %phitmp, 1
 
28
  br label %8
 
29
 
 
30
; <label>:8                                       ; preds = %._crit_edge, %0
 
31
  %which.0.lcssa = phi i32 [ %phitmp11, %._crit_edge ], [ 1, %0 ]
 
32
  %9 = icmp eq i32 %argc, 1121
 
33
  br i1 %9, label %14, label %10
 
34
 
 
35
; <label>:10                                      ; preds = %8
 
36
  %11 = getelementptr inbounds [2 x i8*]* @_ZZ4mainE5addrs, i32 0, i32 %which.0.lcssa
 
37
  %12 = load i8** %11, align 4
 
38
  %13 = add nsw i32 %argc, 111
 
39
  br label %17
 
40
 
 
41
; <label>:14                                      ; preds = %17, %8
 
42
  %15 = phi i32 [ 100, %17 ], [ 222, %8 ]
 
43
  %16 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 %15)
 
44
  ret i32 0
 
45
 
 
46
; <label>:17                                      ; preds = %19, %10
 
47
  %18 = phi i8* [ %12, %10 ], [ blockaddress(@main, %14), %19 ]
 
48
  indirectbr i8* %18, [label %14, label %19]
 
49
 
 
50
; <label>:19                                      ; preds = %17
 
51
  %20 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str1, i32 0, i32 0), i32 %13)
 
52
  br label %17
 
53
}
 
54
 
 
55
declare i32 @printf(i8* nocapture, ...) nounwind
 
56
 
 
57
define i8* @memcpy(i8* noalias %dest, i8* noalias %src, i32 %n) nounwind {
 
58
  %1 = ptrtoint i8* %dest to i32
 
59
  %2 = ptrtoint i8* %src to i32
 
60
  %3 = xor i32 %2, %1
 
61
  %4 = and i32 %3, 3
 
62
  %5 = icmp eq i32 %4, 0
 
63
  br i1 %5, label %.preheader28, label %.preheader
 
64
 
 
65
.preheader28:                                     ; preds = %0
 
66
  %6 = and i32 %1, 3
 
67
  %7 = icmp eq i32 %6, 0
 
68
  %8 = icmp eq i32 %n, 0
 
69
  %or.cond29 = or i1 %7, %8
 
70
  br i1 %or.cond29, label %.critedge, label %.lr.ph33
 
71
 
 
72
.lr.ph33:                                         ; preds = %.lr.ph33, %.preheader28
 
73
  %s.032 = phi i8* [ %9, %.lr.ph33 ], [ %src, %.preheader28 ]
 
74
  %d.031 = phi i8* [ %11, %.lr.ph33 ], [ %dest, %.preheader28 ]
 
75
  %.030 = phi i32 [ %12, %.lr.ph33 ], [ %n, %.preheader28 ]
 
76
  %9 = getelementptr inbounds i8* %s.032, i32 1
 
77
  %10 = load i8* %s.032, align 1
 
78
  %11 = getelementptr inbounds i8* %d.031, i32 1
 
79
  store i8 %10, i8* %d.031, align 1
 
80
  %12 = add i32 %.030, -1
 
81
  %13 = ptrtoint i8* %11 to i32
 
82
  %14 = and i32 %13, 3
 
83
  %15 = icmp eq i32 %14, 0
 
84
  %16 = icmp eq i32 %12, 0
 
85
  %or.cond = or i1 %15, %16
 
86
  br i1 %or.cond, label %.critedge, label %.lr.ph33
 
87
 
 
88
.critedge:                                        ; preds = %.lr.ph33, %.preheader28
 
89
  %.lcssa = phi i1 [ %8, %.preheader28 ], [ %16, %.lr.ph33 ]
 
90
  %s.0.lcssa = phi i8* [ %src, %.preheader28 ], [ %9, %.lr.ph33 ]
 
91
  %d.0.lcssa = phi i8* [ %dest, %.preheader28 ], [ %11, %.lr.ph33 ]
 
92
  %.0.lcssa = phi i32 [ %n, %.preheader28 ], [ %12, %.lr.ph33 ]
 
93
  br i1 %.lcssa, label %.loopexit, label %17
 
94
 
 
95
; <label>:17                                      ; preds = %.critedge
 
96
  %18 = bitcast i8* %d.0.lcssa to i32*
 
97
  %19 = bitcast i8* %s.0.lcssa to i32*
 
98
  %20 = icmp ugt i32 %.0.lcssa, 3
 
99
  br i1 %20, label %.lr.ph25, label %._crit_edge
 
100
 
 
101
.lr.ph25:                                         ; preds = %.lr.ph25, %17
 
102
  %ws.024 = phi i32* [ %21, %.lr.ph25 ], [ %19, %17 ]
 
103
  %wd.023 = phi i32* [ %23, %.lr.ph25 ], [ %18, %17 ]
 
104
  %.122 = phi i32 [ %24, %.lr.ph25 ], [ %.0.lcssa, %17 ]
 
105
  %21 = getelementptr inbounds i32* %ws.024, i32 1
 
106
  %22 = load i32* %ws.024, align 4
 
107
  %23 = getelementptr inbounds i32* %wd.023, i32 1
 
108
  store i32 %22, i32* %wd.023, align 4
 
109
  %24 = add i32 %.122, -4
 
110
  %25 = icmp ugt i32 %24, 3
 
111
  br i1 %25, label %.lr.ph25, label %._crit_edge
 
112
 
 
113
._crit_edge:                                      ; preds = %.lr.ph25, %17
 
114
  %ws.0.lcssa = phi i32* [ %19, %17 ], [ %21, %.lr.ph25 ]
 
115
  %wd.0.lcssa = phi i32* [ %18, %17 ], [ %23, %.lr.ph25 ]
 
116
  %.1.lcssa = phi i32 [ %.0.lcssa, %17 ], [ %24, %.lr.ph25 ]
 
117
  %26 = bitcast i32* %wd.0.lcssa to i8*
 
118
  %27 = bitcast i32* %ws.0.lcssa to i8*
 
119
  br label %.preheader
 
120
 
 
121
.preheader:                                       ; preds = %._crit_edge, %0
 
122
  %.2.ph = phi i32 [ %n, %0 ], [ %.1.lcssa, %._crit_edge ]
 
123
  %d.1.ph = phi i8* [ %dest, %0 ], [ %26, %._crit_edge ]
 
124
  %s.1.ph = phi i8* [ %src, %0 ], [ %27, %._crit_edge ]
 
125
  %28 = icmp eq i32 %.2.ph, 0
 
126
  br i1 %28, label %.loopexit, label %.lr.ph
 
127
 
 
128
.lr.ph:                                           ; preds = %.lr.ph, %.preheader
 
129
  %s.121 = phi i8* [ %29, %.lr.ph ], [ %s.1.ph, %.preheader ]
 
130
  %d.120 = phi i8* [ %31, %.lr.ph ], [ %d.1.ph, %.preheader ]
 
131
  %.219 = phi i32 [ %32, %.lr.ph ], [ %.2.ph, %.preheader ]
 
132
  %29 = getelementptr inbounds i8* %s.121, i32 1
 
133
  %30 = load i8* %s.121, align 1
 
134
  %31 = getelementptr inbounds i8* %d.120, i32 1
 
135
  store i8 %30, i8* %d.120, align 1
 
136
  %32 = add i32 %.219, -1
 
137
  %33 = icmp eq i32 %32, 0
 
138
  br i1 %33, label %.loopexit, label %.lr.ph
 
139
 
 
140
.loopexit:                                        ; preds = %.lr.ph, %.preheader, %.critedge
 
141
  ret i8* %dest
 
142
}