1
1
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/abi %s -emit-ir | FileCheck -check-prefix=%target-cpu-%target-os %s
2
2
3
3
// FIXME: rdar://problem/19648117 Needs splitting objc parts out
4
- // UNSUPPORTED: OS=tvos
5
4
// XFAIL: linux
6
5
7
6
import gadget
@@ -14,6 +13,7 @@ import Foundation
14
13
}
15
14
16
15
// arm64-ios: [[ARM64MYRECT:%.*]] = type { float, float, float, float }
16
+ // arm64-tvos: [[ARM64MYRECT:%.*]] = type { float, float, float, float }
17
17
18
18
class Foo {
19
19
// x86_64-macosx: define hidden void @_TFC8abitypes3Foo3barfS0_FT_VSC6MyRect(%VSC6MyRect* noalias sret, %C8abitypes3Foo*) {{.*}} {
@@ -26,6 +26,10 @@ class Foo {
26
26
// armv7-ios: define hidden void @_TToFC8abitypes3Foo3barfS0_FT_VSC6MyRect(%VSC6MyRect* noalias sret, i8*, i8*) unnamed_addr {{.*}} {
27
27
// arm64-ios: define hidden void @_TFC8abitypes3Foo3barfS0_FT_VSC6MyRect(%VSC6MyRect* noalias sret, %C8abitypes3Foo*) {{.*}} {
28
28
// arm64-ios: define hidden [[ARM64MYRECT]] @_TToFC8abitypes3Foo3barfS0_FT_VSC6MyRect(i8*, i8*) unnamed_addr {{.*}} {
29
+ // x86_64-tvos: define hidden void @_TFC8abitypes3Foo3barfS0_FT_VSC6MyRect(%VSC6MyRect* noalias sret, %C8abitypes3Foo*) {{.*}} {
30
+ // x86_64-tvos: define hidden { <2 x float>, <2 x float> } @_TToFC8abitypes3Foo3barfS0_FT_VSC6MyRect(i8*, i8*) unnamed_addr {{.*}} {
31
+ // arm64-tvos: define hidden void @_TFC8abitypes3Foo3barfS0_FT_VSC6MyRect(%VSC6MyRect* noalias sret, %C8abitypes3Foo*) {{.*}} {
32
+ // arm64-tvos: define hidden [[ARM64MYRECT]] @_TToFC8abitypes3Foo3barfS0_FT_VSC6MyRect(i8*, i8*) unnamed_addr {{.*}} {
29
33
dynamic func bar( ) -> MyRect {
30
34
return MyRect ( x: 1 , y: 2 , width: 3 , height: 4 )
31
35
}
@@ -208,6 +212,18 @@ class Foo {
208
212
// i386-ios-fixme: [[R2:%[0-9]+]] = call i1 @_TFC8abitypes3Foo6negate{{.*}}(i1 [[R1]]
209
213
// i386-ios-fixme: [[R3:%[0-9]+]] = call i8 @_TF10ObjectiveC22_convertBoolToObjCBool{{.*}}(i1 [[R2]]
210
214
// i386-ios-fixme: ret i8 [[R3]]
215
+ //
216
+ // x86_64-tvos-fixme: define hidden i1 @_TFC8abitypes3Foo6negatefS0_FTSb_Sb(i1, %C8abitypes3Foo*) {{.*}} {
217
+ // x86_64-tvos-fixme: define internal zeroext i1 @_TToFC8abitypes3Foo6negatefS0_FT
218
+ // x86_64-tvos-fixme: [[R1:%[0-9]+]] = call i1 @_TF10ObjectiveC22_convertObjCBoolToBoolFT1xVS_8ObjCBool_Sb(i1 %2)
219
+ // x86_64-tvos-fixme: [[R2:%[0-9]+]] = call i1 @_TFC8abitypes3Foo6negatefS0_FTSb_Sb(i1 [[R1]]
220
+ // x86_64-tvos-fixme: [[R3:%[0-9]+]] = call i1 @_TF10ObjectiveC22_convertBoolToObjCBoolFT1xSb_VS_8ObjCBool(i1 [[R2]])
221
+ // x86_64-tvos-fixme: ret i1 [[R3]]
222
+ //
223
+ // arm64-tvos-fixme: define hidden i1 @_TFC8abitypes3Foo6negate{{.*}}(i1, %C8abitypes3Foo*) {{.*}} {
224
+ // arm64-tvos-fixme: define internal zeroext i1 @_TToFC8abitypes3Foo6negate
225
+ // arm64-tvos-fixme: [[R2:%[0-9]+]] = call i1 @_TFC8abitypes3Foo6negate
226
+ // arm64-tvos-fixme: ret i1 [[R2]]
211
227
dynamic func negate( b: Bool ) -> Bool {
212
228
return !b
213
229
}
@@ -271,6 +287,26 @@ class Foo {
271
287
// i386-ios: [[TOOBJCBOOL:%[0-9]+]] = call i8 @_TF10ObjectiveC22_convertBoolToObjCBool{{.*}}(i1 [[NEG]])
272
288
// i386-ios: ret i8 [[TOOBJCBOOL]]
273
289
//
290
+ // x86_64-tvos: define hidden i1 @_TFC8abitypes3Foo7negate2{{.*}}(i1, %C8abitypes3Foo*) {{.*}} {
291
+ // x86_64-tvos: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negate:)", align 8
292
+ // x86_64-tvos: [[NEG:%[0-9]+]] = call zeroext i1 bitcast (void ()* @objc_msgSend to i1 ([[RECEIVER:.*]]*, i8*, i1)*)([[RECEIVER]]* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext %0)
293
+ // x86_64-tvos: ret i1 [[NEG]]
294
+ //
295
+ // x86_64-tvos: define hidden zeroext i1 @_TToFC8abitypes3Foo7negate2{{.*}}(i8*, i8*, i1 zeroext)
296
+ // x86_64-tvos: [[NEG:%[0-9]+]] = call i1 @_TFC8abitypes3Foo7negate2{{.*}}(i1
297
+ // x86_64-tvos: [[TOOBJCBOOL:%[0-9]+]] = call i1 @_TF10ObjectiveC22_convertBoolToObjCBool{{.*}}(i1 [[NEG]])
298
+ // x86_64-tvos: ret i1 [[TOOBJCBOOL]]
299
+ //
300
+ // arm64-tvos: define hidden i1 @_TFC8abitypes3Foo7negate2{{.*}}(i1, %C8abitypes3Foo*) {{.*}} {
301
+ // arm64-tvos: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negate:)", align 8
302
+ // arm64-tvos: [[NEG:%[0-9]+]] = call zeroext i1 bitcast (void ()* @objc_msgSend to i1 ([[RECEIVER:.*]]*, i8*, i1)*)([[RECEIVER]]* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext %0)
303
+ // arm64-tvos: ret i1 [[NEG]]
304
+ //
305
+ // arm64-tvos: define hidden zeroext i1 @_TToFC8abitypes3Foo7negate2{{.*}}(i8*, i8*, i1 zeroext)
306
+ // arm64-tvos: [[NEG:%[0-9]+]] = call i1 @_TFC8abitypes3Foo7negate2{{.*}}(i1
307
+ // arm64-tvos: [[TOOBJCBOOL:%[0-9]+]] = call i1 @_TF10ObjectiveC22_convertBoolToObjCBool{{.*}}(i1 [[NEG]])
308
+ // arm64-tvos: ret i1 [[TOOBJCBOOL]]
309
+ //
274
310
dynamic func negate2( b: Bool ) -> Bool {
275
311
var g = Gadget ( )
276
312
return g. negate ( b)
@@ -327,6 +363,9 @@ class Foo {
327
363
328
364
// arm64-ios: define hidden void @_TFC8abitypes3Foo14callJustReturn{{.*}}(%VSC9BigStruct* noalias sret, %CSo13StructReturns*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %C8abitypes3Foo*) {{.*}} {
329
365
// arm64-ios: define hidden void @_TToFC8abitypes3Foo14callJustReturnfS0_FTCSo13StructReturns4withVSC9BigStruct_S2_(%VSC9BigStruct* noalias sret, i8*, i8*, [[OPAQUE:.*]]*, %VSC9BigStruct*) unnamed_addr {{.*}} {
366
+ //
367
+ // arm64-tvos: define hidden void @_TFC8abitypes3Foo14callJustReturn{{.*}}(%VSC9BigStruct* noalias sret, %CSo13StructReturns*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %C8abitypes3Foo*) {{.*}} {
368
+ // arm64-tvos: define hidden void @_TToFC8abitypes3Foo14callJustReturnfS0_FTCSo13StructReturns4withVSC9BigStruct_S2_(%VSC9BigStruct* noalias sret, i8*, i8*, [[OPAQUE:.*]]*, %VSC9BigStruct*) unnamed_addr {{.*}} {
330
369
dynamic func callJustReturn( r: StructReturns , with v: BigStruct ) -> BigStruct {
331
370
return r. justReturn ( v)
332
371
}
0 commit comments