~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/cases/phiptrtoint.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; ModuleID = '/tmp/tmpJctwj0/bug.bc'
 
2
; just an asm validation check, no output
 
3
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
 
4
target triple = "le32-unknown-nacl"
 
5
 
 
6
%"class.test::Processor" = type { i32, %"class.test::StateMachine" }
 
7
%"class.test::StateMachine" = type { { i32, i32 } }
 
8
 
 
9
@_ZN4test9ProcessorC1Ev = alias internal void (%"class.test::Processor"*)* @_ZN4test9ProcessorC2Ev
 
10
@_ZN4test9ProcessorD1Ev = alias internal void (%"class.test::Processor"*)* @_ZN4test9ProcessorD2Ev
 
11
 
 
12
define internal void @_ZN4test9ProcessorC2Ev(%"class.test::Processor"* nocapture %this) unnamed_addr nounwind align 2 {
 
13
  %1 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 0
 
14
  store i32 0, i32* %1, align 4
 
15
  %2 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 1, i32 0
 
16
  store { i32, i32 } zeroinitializer, { i32, i32 }* %2, align 4
 
17
  ret void
 
18
}
 
19
 
 
20
define internal void @_ZN4test9ProcessorD2Ev(%"class.test::Processor"* nocapture %this) unnamed_addr nounwind readnone align 2 {
 
21
  ret void
 
22
}
 
23
 
 
24
define internal zeroext i1 @_ZN4test9Processor16handleFirstStateEv(%"class.test::Processor"* nocapture %this) align 2 {
 
25
  %1 = tail call i32 @rand()
 
26
  %2 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 0
 
27
  %3 = load i32* %2, align 4
 
28
  %4 = add nsw i32 %3, %1
 
29
  store i32 %4, i32* %2, align 4
 
30
  %5 = and i32 %4, 1
 
31
  %6 = icmp eq i32 %5, 0
 
32
  ret i1 %6
 
33
}
 
34
 
 
35
declare i32 @rand()
 
36
 
 
37
define internal zeroext i1 @_ZN4test9Processor15handleLastStateEv(%"class.test::Processor"* nocapture %this) align 2 {
 
38
  %1 = tail call i32 @rand()
 
39
  %2 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 0
 
40
  %3 = load i32* %2, align 4
 
41
  %4 = add nsw i32 %3, %1
 
42
  store i32 %4, i32* %2, align 4
 
43
  ret i1 true
 
44
}
 
45
 
 
46
define internal zeroext i1 @_ZN4test9Processor3runEv(%"class.test::Processor"* %this) align 2 {
 
47
  %1 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 1, i32 0
 
48
  store { i32, i32 } { i32 ptrtoint (i1 (%"class.test::Processor"*)* @_ZN4test9Processor16handleFirstStateEv to i32), i32 0 }, { i32, i32 }* %1, align 4
 
49
  %2 = bitcast %"class.test::Processor"* %this to i8*
 
50
  br label %.backedge
 
51
 
 
52
.backedge:                                        ; preds = %25, %..backedge_crit_edge, %0
 
53
  %3 = phi { i32, i32 } [ { i32 ptrtoint (i1 (%"class.test::Processor"*)* @_ZN4test9Processor16handleFirstStateEv to i32), i32 0 }, %0 ], [ %.pre.pre, %..backedge_crit_edge ], [ { i32 ptrtoint (i1 (%"class.test::Processor"*)* @_ZN4test9Processor15handleLastStateEv to i32), i32 0 }, %25 ]
 
54
  %.fca.0.extract = extractvalue { i32, i32 } %3, 0
 
55
  %.fca.1.extract = extractvalue { i32, i32 } %3, 1
 
56
  %4 = icmp ne i32 %.fca.0.extract, ptrtoint (i1 (%"class.test::Processor"*)* @_ZN4test9Processor15handleLastStateEv to i32)
 
57
  %5 = icmp ne i32 %.fca.0.extract, 0
 
58
  %6 = icmp ne i32 %.fca.1.extract, 0
 
59
  %7 = and i1 %5, %6
 
60
  %8 = or i1 %4, %7
 
61
  %9 = getelementptr inbounds i8* %2, i32 %.fca.1.extract
 
62
  %10 = bitcast i8* %9 to %"class.test::Processor"*
 
63
  %11 = and i32 %.fca.0.extract, 1
 
64
  %12 = icmp eq i32 %11, 0
 
65
  br i1 %12, label %20, label %13
 
66
 
 
67
; <label>:13                                      ; preds = %.backedge
 
68
  %14 = bitcast i8* %9 to i8**
 
69
  %15 = load i8** %14, align 4
 
70
  %16 = add i32 %.fca.0.extract, -1
 
71
  %17 = getelementptr i8* %15, i32 %16
 
72
  %18 = bitcast i8* %17 to i1 (%"class.test::Processor"*)**
 
73
  %19 = load i1 (%"class.test::Processor"*)** %18, align 4
 
74
  br label %_ZN4test12StateMachineINS_9ProcessorEE11handleStateEPS1_.exit
 
75
 
 
76
; <label>:20                                      ; preds = %.backedge
 
77
  %21 = inttoptr i32 %.fca.0.extract to i1 (%"class.test::Processor"*)*
 
78
  br label %_ZN4test12StateMachineINS_9ProcessorEE11handleStateEPS1_.exit
 
79
 
 
80
_ZN4test12StateMachineINS_9ProcessorEE11handleStateEPS1_.exit: ; preds = %20, %13
 
81
  %22 = phi i1 (%"class.test::Processor"*)* [ %19, %13 ], [ %21, %20 ]
 
82
  %23 = tail call zeroext i1 %22(%"class.test::Processor"* %10)
 
83
  br i1 %8, label %24, label %26
 
84
 
 
85
; <label>:24                                      ; preds = %_ZN4test12StateMachineINS_9ProcessorEE11handleStateEPS1_.exit
 
86
  br i1 %23, label %25, label %..backedge_crit_edge
 
87
 
 
88
..backedge_crit_edge:                             ; preds = %24
 
89
  %.pre.pre = load { i32, i32 }* %1, align 4
 
90
  br label %.backedge
 
91
 
 
92
; <label>:25                                      ; preds = %24
 
93
  store { i32, i32 } { i32 ptrtoint (i1 (%"class.test::Processor"*)* @_ZN4test9Processor15handleLastStateEv to i32), i32 0 }, { i32, i32 }* %1, align 4
 
94
  br label %.backedge
 
95
 
 
96
; <label>:26                                      ; preds = %_ZN4test12StateMachineINS_9ProcessorEE11handleStateEPS1_.exit
 
97
  ret i1 %23
 
98
}
 
99
 
 
100
define internal i32 @_ZNK4test9Processor6resultEv(%"class.test::Processor"* nocapture %this) nounwind readonly align 2 {
 
101
  %1 = getelementptr inbounds %"class.test::Processor"* %this, i32 0, i32 0
 
102
  %2 = load i32* %1, align 4
 
103
  ret i32 %2
 
104
}
 
105
 
 
106
define i32 @runProcess() {
 
107
  %processor = alloca %"class.test::Processor", align 4
 
108
  call void @_ZN4test9ProcessorC1Ev(%"class.test::Processor"* %processor)
 
109
  %1 = invoke zeroext i1 @_ZN4test9Processor3runEv(%"class.test::Processor"* %processor)
 
110
          to label %2 unwind label %5
 
111
 
 
112
; <label>:2                                       ; preds = %0
 
113
  %3 = invoke i32 @_ZNK4test9Processor6resultEv(%"class.test::Processor"* %processor)
 
114
          to label %4 unwind label %5
 
115
 
 
116
; <label>:4                                       ; preds = %2
 
117
  call void @_ZN4test9ProcessorD1Ev(%"class.test::Processor"* %processor)
 
118
  ret i32 %3
 
119
 
 
120
; <label>:5                                       ; preds = %2, %0
 
121
  %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
 
122
          cleanup
 
123
  invoke void @_ZN4test9ProcessorD1Ev(%"class.test::Processor"* %processor)
 
124
          to label %7 unwind label %8
 
125
 
 
126
; <label>:7                                       ; preds = %5
 
127
  resume { i8*, i32 } %6
 
128
 
 
129
; <label>:8                                       ; preds = %5
 
130
  %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
 
131
          catch i8* null
 
132
  call void @_ZSt9terminatev() noreturn nounwind
 
133
  unreachable
 
134
}
 
135
 
 
136
declare i32 @__gxx_personality_v0(...)
 
137
 
 
138
declare void @_ZSt9terminatev()