@@ -18,6 +18,7 @@ import Foundation
18
18
// arm64-tvos: [[ARM64_MYRECT:%.*]] = type { float, float, float, float }
19
19
// armv7k-watchos: [[ARMV7K_MYRECT:%.*]] = type { float, float, float, float }
20
20
// arm64_32-watchos: [[ARM64_MYRECT:%.*]] = type { float, float, float, float }
21
+ // arm64-watchos: [[ARM64_MYRECT:%.*]] = type { float, float, float, float }
21
22
// arm64-macosx: [[ARM64_MYRECT:%.*]] = type { float, float, float, float }
22
23
23
24
class Foo {
@@ -43,6 +44,8 @@ class Foo {
43
44
// armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1) {{[#0-9]*}} {
44
45
// armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(%T8abitypes3FooC* swiftself %0) {{.*}} {
45
46
// armv64_32-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1) {{[#0-9]*}} {
47
+ // arm64-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(%T8abitypes3FooC* swiftself %0) {{.*}} {
48
+ // arm64-watchos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1) {{[#0-9]*}} {
46
49
// x86_64-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(%T8abitypes3FooC* swiftself %0) {{.*}} {
47
50
// x86_64-watchos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1) {{[#0-9]*}} {
48
51
@objc dynamic func bar( ) -> MyRect {
@@ -323,6 +326,11 @@ class Foo {
323
326
// i386-watchos: [[R2:%[0-9]+]] = call swiftcc i1 @"$s8abitypes3FooC6negate{{[_0-9a-zA-Z]*}}F"(i1 [[R1]]
324
327
// i386-watchos: [[R3:%[0-9]+]] = call swiftcc i1 @"$s10ObjectiveC22_convertBoolToObjCBoolyAA0eF0VSbF"(i1 [[R2]])
325
328
// i386-watchos: ret i1 [[R3]]
329
+ //
330
+ // arm64-watchos-fixme: define hidden i1 @"$s8abitypes3FooC6negate{{[_0-9a-zA-Z]*}}F"(i1, %T8abitypes3FooC*) {{.*}} {
331
+ // arm64-watchos-fixme: define internal zeroext i1 @"$s8abitypes3FooC6negate{{[_0-9a-zA-Z]*}}FTo"
332
+ // arm64-watchos-fixme: [[R2:%[0-9]+]] = call i1 @"$s8abitypes3FooC6negate{{[_0-9a-zA-Z]*}}F"
333
+ // arm64-watchos-fixme: ret i1 [[R2]]
326
334
327
335
@objc dynamic func negate( _ b: Bool ) -> Bool {
328
336
return !b
@@ -445,7 +453,16 @@ class Foo {
445
453
// armv7k-watchos: [[TOOBJCBOOL:%[0-9]+]] = call swiftcc i1 @"$s10ObjectiveC22_convertBoolToObjCBool{{[_0-9a-zA-Z]*}}F"(i1 [[NEG]])
446
454
// armv7k-watchos: ret i1 [[TOOBJCBOOL]]
447
455
//
448
-
456
+ // arm64-watchos: define hidden swiftcc i1 @"$s8abitypes3FooC7negate2{{[_0-9a-zA-Z]*}}F"(i1 %0, %T8abitypes3FooC* swiftself %1) {{.*}} {
457
+ // arm64-watchos: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negate:)", align 8
458
+ // arm64-watchos: [[NEG:%[0-9]+]] = call zeroext i1 bitcast (void ()* @objc_msgSend to i1 ([[RECEIVER:.*]]*, i8*, i1)*)([[RECEIVER]]* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext %0)
459
+ // arm64-watchos: ret i1 [[NEG]]
460
+ //
461
+ // arm64-watchos: define internal zeroext i1 @"$s8abitypes3FooC7negate2{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1, i1 zeroext %2)
462
+ // arm64-watchos: [[NEG:%[0-9]+]] = call swiftcc i1 @"$s8abitypes3FooC7negate2{{[_0-9a-zA-Z]*}}F"(i1
463
+ // arm64-watchos: [[TOOBJCBOOL:%[0-9]+]] = call swiftcc i1 @"$s10ObjectiveC22_convertBoolToObjCBool{{[_0-9a-zA-Z]*}}F"(i1 [[NEG]])
464
+ // arm64-watchos: ret i1 [[TOOBJCBOOL]]
465
+ //
449
466
// arm64-macosx: define internal zeroext i1 @"$s8abitypes3FooC7negate2{{[_0-9a-zA-Z]*}}FTo"(i8* %0, i8* %1, i1 zeroext %2)
450
467
// arm64-macosx: [[NEG:%[0-9]+]] = call swiftcc i1 @"$s8abitypes3FooC7negate2{{[_0-9a-zA-Z]*}}F"(i1
451
468
// arm64-macosx: [[TOOBJCBOOL:%[0-9]+]] = call swiftcc i1 @"$s10ObjectiveC22_convertBoolToObjCBool{{[_0-9a-zA-Z]*}}F"(i1 [[NEG]])
@@ -556,6 +573,9 @@ class Foo {
556
573
// arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(%TSo9BigStructV* noalias nocapture sret({{.*}}) %0, i8* %1, i8* %2, [[OPAQUE:.*]]* %3, %TSo9BigStructV* %4) {{[#0-9]*}} {
557
574
// arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(%TSo13StructReturnsC* %0, i64 %1, i64 %2, i64 %3, i64 %4, %T8abitypes3FooC* swiftself %5) {{.*}} {
558
575
// arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(%TSo9BigStructV* noalias nocapture sret({{.*}}) %0, i8* %1, i8* %2, [[OPAQUE:.*]]* %3, %TSo9BigStructV* %4) {{.*}} {
576
+ //
577
+ // arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(%TSo13StructReturnsC* %0, i64 %1, i64 %2, i64 %3, i64 %4, %T8abitypes3FooC* swiftself %5) {{.*}} {
578
+ // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(%TSo9BigStructV* noalias nocapture sret({{.*}}) %0, i8* %1, i8* %2, [[OPAQUE:.*]]* %3, %TSo9BigStructV* %4) {{[#0-9]*}} {
559
579
@objc dynamic func callJustReturn( _ r: StructReturns , with v: BigStruct ) -> BigStruct {
560
580
return r. justReturn ( v)
561
581
}
@@ -621,6 +641,17 @@ public func testInlineAgg(_ rect: MyRect) -> Float {
621
641
// arm64-macosx: store i8 0, i8* [[BYTE_ADDR]], align 8
622
642
// arm64-macosx: [[ARG:%.*]] = load i64, i64* [[COERCED]]
623
643
// arm64-macosx: call void bitcast (void ()* @objc_msgSend to void (i8*, i8*, i64)*)(i8* {{.*}}, i8* {{.*}}, i64 [[ARG]])
644
+ //
645
+ // arm64-watchos: define swiftcc void @"$s8abitypes14testBOOLStructyyF"()
646
+ // arm64-watchos: [[COERCED:%.*]] = alloca i64
647
+ // arm64-watchos: [[STRUCTPTR:%.*]] = bitcast i64* [[COERCED]] to %TSo14FiveByteStructV
648
+ // arm64-watchos: [[PTR0:%.*]] = getelementptr inbounds %TSo14FiveByteStructV, %TSo14FiveByteStructV* [[STRUCTPTR]], {{i.*}} 0, {{i.*}} 0
649
+ // arm64-watchos: [[PTR1:%.*]] = getelementptr inbounds %T10ObjectiveC8ObjCBoolV, %T10ObjectiveC8ObjCBoolV* [[PTR0]], {{i.*}} 0, {{i.*}} 0
650
+ // arm64-watchos: [[PTR2:%.*]] = getelementptr inbounds %TSb, %TSb* [[PTR1]], {{i.*}} 0, {{i.*}} 0
651
+ // arm64-watchos: [[BYTE_ADDR:%.*]] = bitcast i1* [[PTR2]] to i8*
652
+ // arm64-watchos: store i8 0, i8* [[BYTE_ADDR]], align 8
653
+ // arm64-watchos: [[ARG:%.*]] = load i64, i64* [[COERCED]]
654
+ // arm64-watchos: call void bitcast (void ()* @objc_msgSend to void (i8*, i8*, i64)*)(i8* {{.*}}, i8* {{.*}}, i64 [[ARG]])
624
655
public func testBOOLStruct( ) {
625
656
let s = FiveByteStruct ( )
626
657
MyClass . mymethod ( s)
0 commit comments