|
1 |
| -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/abi %s -emit-ir -module-name abitypes -enable-objc-interop | %FileCheck -check-prefix=%target-cpu-%target-os-abi %s |
| 1 | +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/abi %s -emit-ir -enable-objc-interop | %FileCheck -check-prefix=%target-cpu-%target-os-abi %s |
2 | 2 |
|
3 |
| -// REQUIRES: objc_interop |
| 3 | +// FIXME: rdar://problem/19648117 Needs splitting objc parts out |
| 4 | +// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi |
4 | 5 |
|
5 | 6 | import gadget
|
6 |
| -import c_gadget |
7 | 7 | import Foundation
|
8 | 8 |
|
9 | 9 | @objc protocol P1 {}
|
@@ -559,6 +559,33 @@ class Foo {
|
559 | 559 | @objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct {
|
560 | 560 | return r.justReturn(v)
|
561 | 561 | }
|
| 562 | + |
| 563 | + // Test that the makeOne() that we generate somewhere below doesn't |
| 564 | + // use arm_aapcscc for armv7. |
| 565 | + func callInline() -> Float { |
| 566 | + return makeOne(3,5).second |
| 567 | + } |
| 568 | +} |
| 569 | + |
| 570 | +// armv7-ios: define internal void @makeOne(ptr noalias sret({{.*}}) align 4 %agg.result, float %f, float %s) |
| 571 | +// armv7s-ios: define internal void @makeOne(ptr noalias sret({{.*}}) align 4 %agg.result, float %f, float %s) |
| 572 | +// armv7k-watchos: define internal %struct.One @makeOne(float {{.*}}%f, float {{.*}}%s) |
| 573 | + |
| 574 | +// rdar://17631440 - Expand direct arguments that are coerced to aggregates. |
| 575 | +// x86_64-macosx: define{{( protected)?}} swiftcc float @"$s8abitypes13testInlineAggySfSo6MyRectVF"(float %0, float %1, float %2, float %3) {{.*}} { |
| 576 | +// x86_64-macosx: [[COERCED:%.*]] = alloca %TSo6MyRectV, align 8 |
| 577 | +// x86_64-macosx: store float %0, |
| 578 | +// x86_64-macosx: store float %1, |
| 579 | +// x86_64-macosx: store float %2, |
| 580 | +// x86_64-macosx: store float %3, |
| 581 | +// x86_64-macosx: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 0 |
| 582 | +// x86_64-macosx: [[FIRST_HALF:%.*]] = load <2 x float>, ptr [[T0]], align 8 |
| 583 | +// x86_64-macosx: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 1 |
| 584 | +// x86_64-macosx: [[SECOND_HALF:%.*]] = load <2 x float>, ptr [[T0]], align 8 |
| 585 | +// x86_64-macosx: [[RESULT:%.*]] = call float @MyRect_Area(<2 x float> [[FIRST_HALF]], <2 x float> [[SECOND_HALF]]) |
| 586 | +// x86_64-macosx: ret float [[RESULT]] |
| 587 | +public func testInlineAgg(_ rect: MyRect) -> Float { |
| 588 | + return MyRect_Area(rect) |
562 | 589 | }
|
563 | 590 |
|
564 | 591 | // We need to allocate enough memory on the stack to hold the argument value we load.
|
|
0 commit comments