Skip to content

Commit 2825b4f

Browse files
aykevldeadprogram
authored andcommitted
compiler: update tests after adding new wasm features
I don't understand why this wasn't caught in CI. It should have. In any case, because the llvm-features string was updated, these IR outputs were updated.
1 parent b5c5d95 commit 2825b4f

13 files changed

+360
-337
lines changed

compiler/testdata/basic.ll

+30-28
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ target triple = "wasm32-unknown-wasi"
66
%main.kv = type { float }
77
%main.kv.0 = type { i8 }
88

9-
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
9+
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) #0
1010

11-
declare void @runtime.trackPointer(i8* nocapture readonly, i8*)
11+
declare void @runtime.trackPointer(i8* nocapture readonly, i8*) #0
1212

1313
; Function Attrs: nounwind
14-
define hidden void @main.init(i8* %context) unnamed_addr #0 {
14+
define hidden void @main.init(i8* %context) unnamed_addr #1 {
1515
entry:
1616
ret void
1717
}
1818

1919
; Function Attrs: nounwind
20-
define hidden i32 @main.addInt(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
20+
define hidden i32 @main.addInt(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
2121
entry:
2222
%0 = add i32 %x, %y
2323
ret i32 %0
2424
}
2525

2626
; Function Attrs: nounwind
27-
define hidden i1 @main.equalInt(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
27+
define hidden i1 @main.equalInt(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
2828
entry:
2929
%0 = icmp eq i32 %x, %y
3030
ret i1 %0
3131
}
3232

3333
; Function Attrs: nounwind
34-
define hidden i32 @main.divInt(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
34+
define hidden i32 @main.divInt(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
3535
entry:
3636
%0 = icmp eq i32 %y, 0
3737
br i1 %0, label %divbyzero.throw, label %divbyzero.next
@@ -45,14 +45,14 @@ divbyzero.next: ; preds = %entry
4545
ret i32 %5
4646

4747
divbyzero.throw: ; preds = %entry
48-
call void @runtime.divideByZeroPanic(i8* undef) #0
48+
call void @runtime.divideByZeroPanic(i8* undef) #2
4949
unreachable
5050
}
5151

52-
declare void @runtime.divideByZeroPanic(i8*)
52+
declare void @runtime.divideByZeroPanic(i8*) #0
5353

5454
; Function Attrs: nounwind
55-
define hidden i32 @main.divUint(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
55+
define hidden i32 @main.divUint(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
5656
entry:
5757
%0 = icmp eq i32 %y, 0
5858
br i1 %0, label %divbyzero.throw, label %divbyzero.next
@@ -62,12 +62,12 @@ divbyzero.next: ; preds = %entry
6262
ret i32 %1
6363

6464
divbyzero.throw: ; preds = %entry
65-
call void @runtime.divideByZeroPanic(i8* undef) #0
65+
call void @runtime.divideByZeroPanic(i8* undef) #2
6666
unreachable
6767
}
6868

6969
; Function Attrs: nounwind
70-
define hidden i32 @main.remInt(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
70+
define hidden i32 @main.remInt(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
7171
entry:
7272
%0 = icmp eq i32 %y, 0
7373
br i1 %0, label %divbyzero.throw, label %divbyzero.next
@@ -81,12 +81,12 @@ divbyzero.next: ; preds = %entry
8181
ret i32 %5
8282

8383
divbyzero.throw: ; preds = %entry
84-
call void @runtime.divideByZeroPanic(i8* undef) #0
84+
call void @runtime.divideByZeroPanic(i8* undef) #2
8585
unreachable
8686
}
8787

8888
; Function Attrs: nounwind
89-
define hidden i32 @main.remUint(i32 %x, i32 %y, i8* %context) unnamed_addr #0 {
89+
define hidden i32 @main.remUint(i32 %x, i32 %y, i8* %context) unnamed_addr #1 {
9090
entry:
9191
%0 = icmp eq i32 %y, 0
9292
br i1 %0, label %divbyzero.throw, label %divbyzero.next
@@ -96,66 +96,66 @@ divbyzero.next: ; preds = %entry
9696
ret i32 %1
9797

9898
divbyzero.throw: ; preds = %entry
99-
call void @runtime.divideByZeroPanic(i8* undef) #0
99+
call void @runtime.divideByZeroPanic(i8* undef) #2
100100
unreachable
101101
}
102102

103103
; Function Attrs: nounwind
104-
define hidden i1 @main.floatEQ(float %x, float %y, i8* %context) unnamed_addr #0 {
104+
define hidden i1 @main.floatEQ(float %x, float %y, i8* %context) unnamed_addr #1 {
105105
entry:
106106
%0 = fcmp oeq float %x, %y
107107
ret i1 %0
108108
}
109109

110110
; Function Attrs: nounwind
111-
define hidden i1 @main.floatNE(float %x, float %y, i8* %context) unnamed_addr #0 {
111+
define hidden i1 @main.floatNE(float %x, float %y, i8* %context) unnamed_addr #1 {
112112
entry:
113113
%0 = fcmp une float %x, %y
114114
ret i1 %0
115115
}
116116

117117
; Function Attrs: nounwind
118-
define hidden i1 @main.floatLower(float %x, float %y, i8* %context) unnamed_addr #0 {
118+
define hidden i1 @main.floatLower(float %x, float %y, i8* %context) unnamed_addr #1 {
119119
entry:
120120
%0 = fcmp olt float %x, %y
121121
ret i1 %0
122122
}
123123

124124
; Function Attrs: nounwind
125-
define hidden i1 @main.floatLowerEqual(float %x, float %y, i8* %context) unnamed_addr #0 {
125+
define hidden i1 @main.floatLowerEqual(float %x, float %y, i8* %context) unnamed_addr #1 {
126126
entry:
127127
%0 = fcmp ole float %x, %y
128128
ret i1 %0
129129
}
130130

131131
; Function Attrs: nounwind
132-
define hidden i1 @main.floatGreater(float %x, float %y, i8* %context) unnamed_addr #0 {
132+
define hidden i1 @main.floatGreater(float %x, float %y, i8* %context) unnamed_addr #1 {
133133
entry:
134134
%0 = fcmp ogt float %x, %y
135135
ret i1 %0
136136
}
137137

138138
; Function Attrs: nounwind
139-
define hidden i1 @main.floatGreaterEqual(float %x, float %y, i8* %context) unnamed_addr #0 {
139+
define hidden i1 @main.floatGreaterEqual(float %x, float %y, i8* %context) unnamed_addr #1 {
140140
entry:
141141
%0 = fcmp oge float %x, %y
142142
ret i1 %0
143143
}
144144

145145
; Function Attrs: nounwind
146-
define hidden float @main.complexReal(float %x.r, float %x.i, i8* %context) unnamed_addr #0 {
146+
define hidden float @main.complexReal(float %x.r, float %x.i, i8* %context) unnamed_addr #1 {
147147
entry:
148148
ret float %x.r
149149
}
150150

151151
; Function Attrs: nounwind
152-
define hidden float @main.complexImag(float %x.r, float %x.i, i8* %context) unnamed_addr #0 {
152+
define hidden float @main.complexImag(float %x.r, float %x.i, i8* %context) unnamed_addr #1 {
153153
entry:
154154
ret float %x.i
155155
}
156156

157157
; Function Attrs: nounwind
158-
define hidden { float, float } @main.complexAdd(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #0 {
158+
define hidden { float, float } @main.complexAdd(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #1 {
159159
entry:
160160
%0 = fadd float %x.r, %y.r
161161
%1 = fadd float %x.i, %y.i
@@ -165,7 +165,7 @@ entry:
165165
}
166166

167167
; Function Attrs: nounwind
168-
define hidden { float, float } @main.complexSub(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #0 {
168+
define hidden { float, float } @main.complexSub(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #1 {
169169
entry:
170170
%0 = fsub float %x.r, %y.r
171171
%1 = fsub float %x.i, %y.i
@@ -175,7 +175,7 @@ entry:
175175
}
176176

177177
; Function Attrs: nounwind
178-
define hidden { float, float } @main.complexMul(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #0 {
178+
define hidden { float, float } @main.complexMul(float %x.r, float %x.i, float %y.r, float %y.i, i8* %context) unnamed_addr #1 {
179179
entry:
180180
%0 = fmul float %x.r, %y.r
181181
%1 = fmul float %x.i, %y.i
@@ -189,16 +189,18 @@ entry:
189189
}
190190

191191
; Function Attrs: nounwind
192-
define hidden void @main.foo(%main.kv* dereferenceable_or_null(4) %a, i8* %context) unnamed_addr #0 {
192+
define hidden void @main.foo(%main.kv* dereferenceable_or_null(4) %a, i8* %context) unnamed_addr #1 {
193193
entry:
194194
call void @"main.foo$1"(%main.kv.0* null, i8* undef)
195195
ret void
196196
}
197197

198198
; Function Attrs: nounwind
199-
define hidden void @"main.foo$1"(%main.kv.0* dereferenceable_or_null(1) %b, i8* %context) unnamed_addr #0 {
199+
define hidden void @"main.foo$1"(%main.kv.0* dereferenceable_or_null(1) %b, i8* %context) unnamed_addr #1 {
200200
entry:
201201
ret void
202202
}
203203

204-
attributes #0 = { nounwind }
204+
attributes #0 = { "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" }
205+
attributes #1 = { nounwind "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" }
206+
attributes #2 = { nounwind }

compiler/testdata/channel.ll

+23-21
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ target triple = "wasm32-unknown-wasi"
1111
%"internal/task.stackState" = type { i32, i32 }
1212
%runtime.chanSelectState = type { %runtime.channel*, i8* }
1313

14-
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
14+
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) #0
1515

16-
declare void @runtime.trackPointer(i8* nocapture readonly, i8*)
16+
declare void @runtime.trackPointer(i8* nocapture readonly, i8*) #0
1717

1818
; Function Attrs: nounwind
19-
define hidden void @main.init(i8* %context) unnamed_addr #0 {
19+
define hidden void @main.init(i8* %context) unnamed_addr #1 {
2020
entry:
2121
ret void
2222
}
2323

2424
; Function Attrs: nounwind
25-
define hidden void @main.chanIntSend(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #0 {
25+
define hidden void @main.chanIntSend(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #1 {
2626
entry:
2727
%chan.blockedList = alloca %runtime.channelBlockedList, align 8
2828
%chan.value = alloca i32, align 4
@@ -31,64 +31,64 @@ entry:
3131
store i32 3, i32* %chan.value, align 4
3232
%chan.blockedList.bitcast = bitcast %runtime.channelBlockedList* %chan.blockedList to i8*
3333
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
34-
call void @runtime.chanSend(%runtime.channel* %ch, i8* nonnull %chan.value.bitcast, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #0
34+
call void @runtime.chanSend(%runtime.channel* %ch, i8* nonnull %chan.value.bitcast, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #3
3535
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
3636
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %chan.value.bitcast)
3737
ret void
3838
}
3939

4040
; Function Attrs: argmemonly nofree nosync nounwind willreturn
41-
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
41+
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
4242

43-
declare void @runtime.chanSend(%runtime.channel* dereferenceable_or_null(32), i8*, %runtime.channelBlockedList* dereferenceable_or_null(24), i8*)
43+
declare void @runtime.chanSend(%runtime.channel* dereferenceable_or_null(32), i8*, %runtime.channelBlockedList* dereferenceable_or_null(24), i8*) #0
4444

4545
; Function Attrs: argmemonly nofree nosync nounwind willreturn
46-
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
46+
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
4747

4848
; Function Attrs: nounwind
49-
define hidden void @main.chanIntRecv(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #0 {
49+
define hidden void @main.chanIntRecv(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #1 {
5050
entry:
5151
%chan.blockedList = alloca %runtime.channelBlockedList, align 8
5252
%chan.value = alloca i32, align 4
5353
%chan.value.bitcast = bitcast i32* %chan.value to i8*
5454
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %chan.value.bitcast)
5555
%chan.blockedList.bitcast = bitcast %runtime.channelBlockedList* %chan.blockedList to i8*
5656
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
57-
%0 = call i1 @runtime.chanRecv(%runtime.channel* %ch, i8* nonnull %chan.value.bitcast, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #0
57+
%0 = call i1 @runtime.chanRecv(%runtime.channel* %ch, i8* nonnull %chan.value.bitcast, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #3
5858
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %chan.value.bitcast)
5959
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
6060
ret void
6161
}
6262

63-
declare i1 @runtime.chanRecv(%runtime.channel* dereferenceable_or_null(32), i8*, %runtime.channelBlockedList* dereferenceable_or_null(24), i8*)
63+
declare i1 @runtime.chanRecv(%runtime.channel* dereferenceable_or_null(32), i8*, %runtime.channelBlockedList* dereferenceable_or_null(24), i8*) #0
6464

6565
; Function Attrs: nounwind
66-
define hidden void @main.chanZeroSend(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #0 {
66+
define hidden void @main.chanZeroSend(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #1 {
6767
entry:
6868
%complit = alloca {}, align 8
6969
%chan.blockedList = alloca %runtime.channelBlockedList, align 8
7070
%0 = bitcast {}* %complit to i8*
71-
call void @runtime.trackPointer(i8* nonnull %0, i8* undef) #0
71+
call void @runtime.trackPointer(i8* nonnull %0, i8* undef) #3
7272
%chan.blockedList.bitcast = bitcast %runtime.channelBlockedList* %chan.blockedList to i8*
7373
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
74-
call void @runtime.chanSend(%runtime.channel* %ch, i8* null, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #0
74+
call void @runtime.chanSend(%runtime.channel* %ch, i8* null, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #3
7575
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
7676
ret void
7777
}
7878

7979
; Function Attrs: nounwind
80-
define hidden void @main.chanZeroRecv(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #0 {
80+
define hidden void @main.chanZeroRecv(%runtime.channel* dereferenceable_or_null(32) %ch, i8* %context) unnamed_addr #1 {
8181
entry:
8282
%chan.blockedList = alloca %runtime.channelBlockedList, align 8
8383
%chan.blockedList.bitcast = bitcast %runtime.channelBlockedList* %chan.blockedList to i8*
8484
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
85-
%0 = call i1 @runtime.chanRecv(%runtime.channel* %ch, i8* null, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #0
85+
%0 = call i1 @runtime.chanRecv(%runtime.channel* %ch, i8* null, %runtime.channelBlockedList* nonnull %chan.blockedList, i8* undef) #3
8686
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %chan.blockedList.bitcast)
8787
ret void
8888
}
8989

9090
; Function Attrs: nounwind
91-
define hidden void @main.selectZeroRecv(%runtime.channel* dereferenceable_or_null(32) %ch1, %runtime.channel* dereferenceable_or_null(32) %ch2, i8* %context) unnamed_addr #0 {
91+
define hidden void @main.selectZeroRecv(%runtime.channel* dereferenceable_or_null(32) %ch1, %runtime.channel* dereferenceable_or_null(32) %ch2, i8* %context) unnamed_addr #1 {
9292
entry:
9393
%select.states.alloca = alloca [2 x %runtime.chanSelectState], align 8
9494
%select.send.value = alloca i32, align 4
@@ -105,7 +105,7 @@ entry:
105105
%.repack4 = getelementptr inbounds [2 x %runtime.chanSelectState], [2 x %runtime.chanSelectState]* %select.states.alloca, i32 0, i32 1, i32 1
106106
store i8* null, i8** %.repack4, align 4
107107
%select.states = getelementptr inbounds [2 x %runtime.chanSelectState], [2 x %runtime.chanSelectState]* %select.states.alloca, i32 0, i32 0
108-
%select.result = call { i32, i1 } @runtime.tryChanSelect(i8* undef, %runtime.chanSelectState* nonnull %select.states, i32 2, i32 2, i8* undef) #0
108+
%select.result = call { i32, i1 } @runtime.tryChanSelect(i8* undef, %runtime.chanSelectState* nonnull %select.states, i32 2, i32 2, i8* undef) #3
109109
call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %select.states.alloca.bitcast)
110110
%1 = extractvalue { i32, i1 } %select.result, 0
111111
%2 = icmp eq i32 %1, 0
@@ -122,7 +122,9 @@ select.body: ; preds = %select.next
122122
br label %select.done
123123
}
124124

125-
declare { i32, i1 } @runtime.tryChanSelect(i8*, %runtime.chanSelectState*, i32, i32, i8*)
125+
declare { i32, i1 } @runtime.tryChanSelect(i8*, %runtime.chanSelectState*, i32, i32, i8*) #0
126126

127-
attributes #0 = { nounwind }
128-
attributes #1 = { argmemonly nofree nosync nounwind willreturn }
127+
attributes #0 = { "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" }
128+
attributes #1 = { nounwind "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" }
129+
attributes #2 = { argmemonly nofree nosync nounwind willreturn }
130+
attributes #3 = { nounwind }

0 commit comments

Comments
 (0)