3
3
// Check that importing this module creates the right types
4
4
5
5
// RUN: %target-swift-frontend -emit-module-interface-path %t/private-stored-members.swiftinterface -module-name PrivateStoredMembers -emit-module -o %t/PrivateStoredMembers.swiftmodule %S/private-stored-members.swift
6
- // RUN: %target-swift-frontend %use_no_opaque_pointers -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT | %FileCheck %s --check-prefix CHECK-EXEC --check-prefix CHECK
7
- // RUN: %target-swift-frontend -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT
6
+ // RUN: %target-swift-frontend -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT | %FileCheck %s --check-prefix CHECK-EXEC --check-prefix CHECK
8
7
9
8
// Check that the types are also correct when importing a module created from an interface
10
9
11
10
// RUN: %target-swift-frontend -emit-module -o %t/PrivateStoredMembers.swiftmodule -module-name PrivateStoredMembers %t/private-stored-members.swiftinterface -disable-objc-attr-requires-foundation-module
12
- // RUN: %target-swift-frontend %use_no_opaque_pointers -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT | %FileCheck %s --check-prefix CHECK-EXEC --check-prefix CHECK
13
- // RUN: %target-swift-frontend -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT
11
+ // RUN: %target-swift-frontend -emit-ir %s -I %t 2>&1 -DSHOULD_IMPORT | %FileCheck %s --check-prefix CHECK-EXEC --check-prefix CHECK
14
12
15
13
// Check the types generated when the source file is the primary file, and ensure they're the same layout.
16
14
17
- // RUN: %target-swift-frontend %use_no_opaque_pointers -emit-ir %S/private-stored-members.swift %s 2>&1 -module-name main | %FileCheck %s --check-prefix CHECK-MAIN --check-prefix CHECK-EXEC
18
- // RUN: %target-swift-frontend -emit-ir %S/private-stored-members.swift %s 2>&1 -module-name main
15
+ // RUN: %target-swift-frontend -emit-ir %S/private-stored-members.swift %s 2>&1 -module-name main | %FileCheck %s --check-prefix CHECK-MAIN --check-prefix CHECK-EXEC
19
16
20
17
// These two appear out-of-order between run lines
21
18
22
- // CHECK-DAG: [[MYCLASS:%T20PrivateStoredMembers7MyClassC]] = type
23
19
// CHECK-DAG: [[MYSTRUCT:%T20PrivateStoredMembers8MyStructV]] = type <{ %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V }>
24
20
25
21
// CHECK-MAIN-DAG: [[MYCLASS:%T4main7MyClassC]] = type <{ %swift.refcounted, %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V, %TSb, [7 x i8], %Ts5Int64V }>
@@ -32,22 +28,22 @@ import PrivateStoredMembers
32
28
// CHECK-EXEC: swiftcc void @"$s{{[^ ]+}}8makeUseryyF"() #0 {
33
29
public func makeUser( ) {
34
30
let ptr = UnsafeMutablePointer< MyStruct> . allocate( capacity: 1 )
35
- // CHECK-EXEC: %.publicEndVar = getelementptr inbounds [[MYSTRUCT]], [[MYSTRUCT]]* %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX:12]]
36
- // CHECK-EXEC: %.publicEndVar._value = getelementptr inbounds %Ts5Int64V, %Ts5Int64V* %.publicEndVar, i32 0, i32 0
37
- // CHECK-EXEC: store i64 4, i64* %.publicEndVar._value
31
+ // CHECK-EXEC: %.publicEndVar = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX:12]]
32
+ // CHECK-EXEC: %.publicEndVar._value = getelementptr inbounds %Ts5Int64V, ptr %.publicEndVar, i32 0, i32 0
33
+ // CHECK-EXEC: store i64 4, ptr %.publicEndVar._value
38
34
ptr. pointee. publicEndVar = 4
39
35
40
- // CHECK-EXEC: %.publicEndVar1 = getelementptr inbounds [[MYSTRUCT]], [[MYSTRUCT]]* %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX]]
41
- // CHECK-EXEC: %.publicEndVar1._value = getelementptr inbounds %Ts5Int64V, %Ts5Int64V* %.publicEndVar1, i32 0, i32 0
42
- // CHECK-EXEC: [[PUBLIC_END_VAR_LOAD:%[0-9]+]] = load i64, i64* %.publicEndVar1._value, align 8
36
+ // CHECK-EXEC: %.publicEndVar1 = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX]]
37
+ // CHECK-EXEC: %.publicEndVar1._value = getelementptr inbounds %Ts5Int64V, ptr %.publicEndVar1, i32 0, i32 0
38
+ // CHECK-EXEC: [[PUBLIC_END_VAR_LOAD:%[0-9]+]] = load i64, ptr %.publicEndVar1._value, align 8
43
39
44
- // CHECK-EXEC: %.publicVar = getelementptr inbounds [[MYSTRUCT]], [[MYSTRUCT]]* %{{[0-9]+}}, i32 0, i32 0
45
- // CHECK-EXEC: %.publicVar._value = getelementptr inbounds %Ts5Int64V, %Ts5Int64V* %.publicVar, i32 0, i32 0
46
- // CHECK-EXEC: store i64 [[PUBLIC_END_VAR_LOAD]], i64* %.publicVar._value, align 8
40
+ // CHECK-EXEC: %.publicVar = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 0
41
+ // CHECK-EXEC: %.publicVar._value = getelementptr inbounds %Ts5Int64V, ptr %.publicVar, i32 0, i32 0
42
+ // CHECK-EXEC: store i64 [[PUBLIC_END_VAR_LOAD]], ptr %.publicVar._value, align 8
47
43
ptr. pointee. publicVar = ptr. pointee. publicEndVar
48
44
ptr. deallocate ( )
49
45
50
- // CHECK-EXEC: %[[MYCLASS_INIT:[0-9]+]] = call swiftcc [[MYCLASS]]* @"$s{{[^ ]+}}7MyClassCACycfC"(%swift.type* swiftself %{{[0-9]+}})
46
+ // CHECK-EXEC: %[[MYCLASS_INIT:[0-9]+]] = call swiftcc ptr @"$s{{[^ ]+}}7MyClassCACycfC"(ptr swiftself %{{[0-9]+}})
51
47
let myClass = MyClass ( )
52
48
53
49
// These are uninteresting as they just call into the standard getter and setter.
0 commit comments