|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 | // RUN: %target-swift-frontend -emit-module-interface-path %t/Lib.swiftinterface -typecheck -enable-library-evolution -enable-objc-interop -disable-objc-attr-requires-foundation-module -swift-version 5 %S/Inputs/enums-layout-helper.swift -module-name Lib
|
3 | 3 | // RUN: %FileCheck %S/Inputs/enums-layout-helper.swift < %t/Lib.swiftinterface
|
4 |
| -// RUN: %target-swift-frontend -enable-objc-interop -O -emit-ir -primary-file %s -I %t | %FileCheck %s |
| 4 | +// RUN: %target-swift-frontend -enable-objc-interop -O -emit-ir -primary-file %s -I %t -Xllvm -swiftmergefunc-threshold=0 | %FileCheck %s |
5 | 5 |
|
6 | 6 | import Lib
|
7 | 7 |
|
@@ -34,3 +34,39 @@ func testFrozenObjCEnum() -> FrozenObjCEnum {
|
34 | 34 | // CHECK: ret i{{32|64}} 10
|
35 | 35 | return .b
|
36 | 36 | } // CHECK-NEXT: {{^}$}}
|
| 37 | + |
| 38 | +// CHECK-LABEL: define{{.+}}testFutureproofIndirectEnum |
| 39 | +func testFutureproofIndirectEnum() -> FutureproofIndirectEnum { |
| 40 | + // CHECK: [[CASE:%.+]] = load i32, i32* @"$s3Lib23FutureproofIndirectEnumO1cyA2CmFWC" |
| 41 | + // CHECK: [[METADATA_RESPONSE:%.+]] = tail call swiftcc %swift.metadata_response @"$s3Lib23FutureproofIndirectEnumOMa" |
| 42 | + // CHECK: [[METADATA:%.+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 |
| 43 | + // CHECK: call void {{%.+}}(%swift.opaque* noalias %0, i32 [[CASE]], %swift.type* [[METADATA]]) |
| 44 | + // CHECK-NEXT: ret void |
| 45 | + return .c |
| 46 | +} |
| 47 | + |
| 48 | +// CHECK-LABEL: define{{.+}}testFrozenIndirectEnum |
| 49 | +func testFrozenIndirectEnum() -> FrozenIndirectEnum { |
| 50 | + // Whether this is "1" or "2" depends on whether the reserved ObjC tagged |
| 51 | + // pointer bit is the top or bottom bit on this platform. |
| 52 | + // CHECK: ret i{{32|64}} {{1|2}} |
| 53 | + return .c |
| 54 | +} |
| 55 | + |
| 56 | +// CHECK-LABEL: define{{.+}}testFutureproofIndirectCaseEnum |
| 57 | +func testFutureproofIndirectCaseEnum() -> FutureproofIndirectCaseEnum { |
| 58 | + // CHECK: [[CASE:%.+]] = load i32, i32* @"$s3Lib27FutureproofIndirectCaseEnumO1cyA2CmFWC" |
| 59 | + // CHECK: [[METADATA_RESPONSE:%.+]] = tail call swiftcc %swift.metadata_response @"$s3Lib27FutureproofIndirectCaseEnumOMa" |
| 60 | + // CHECK: [[METADATA:%.+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 |
| 61 | + // CHECK: call void {{%.+}}(%swift.opaque* noalias %0, i32 [[CASE]], %swift.type* [[METADATA]]) |
| 62 | + // CHECK-NEXT: ret void |
| 63 | + return .c |
| 64 | +} |
| 65 | + |
| 66 | +// CHECK-LABEL: define{{.+}}testFrozenIndirectCaseEnum |
| 67 | +func testFrozenIndirectCaseEnum() -> FrozenIndirectCaseEnum { |
| 68 | + // Whether this is "1" or "2" depends on whether the reserved ObjC tagged |
| 69 | + // pointer bit is the top or bottom bit on this platform. |
| 70 | + // CHECK: ret i{{32|64}} {{1|2}} |
| 71 | + return .c |
| 72 | +} |
0 commit comments