1
1
// Target-specific tests for C++ constructor call code generation.
2
2
3
- // RUN: %swift -module-name MySwift -target armv7 -unknown-linux-androideabi -dump-clang-diagnostics -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s -parse-stdlib -parse-as-library -disable-legacy-type-info | %FileCheck %s -check-prefix=ITANIUM_ARM
3
+ // RUN: %swift -module-name MySwift -target aarch64 -unknown-linux-android -dump-clang-diagnostics -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s -parse-stdlib -parse-as-library -disable-legacy-type-info | %FileCheck %s -check-prefix=ITANIUM_ARM
4
4
5
- // REQUIRES: OS=linux-android || OS=linux-androideabi
6
-
7
- // REQUIRES: CODEGENERATOR=X86
8
- // REQUIRES: CODEGENERATOR=ARM
5
+ // REQUIRES: OS=linux-android
6
+ // REQUIRES: CPU=aarch64
9
7
10
8
import Constructors
11
9
import TypeClassification
12
10
13
11
public func createHasVirtualBase( ) -> HasVirtualBase {
14
- // ITANIUM_ARM: define protected swiftcc void @"$s7MySwift20createHasVirtualBaseSo0bcD0VyF "(%TSo14HasVirtualBaseV* noalias nocapture sret({{.*}}) %0)
12
+ // ITANIUM_ARM: define protected swiftcc void @"$s7MySwift20createHasVirtualBaseSo0deF0VyF "(%TSo14HasVirtualBaseV* noalias nocapture sret({{.*}}) %0)
15
13
// To verify that the thunk is inlined, make sure there's no intervening
16
14
// `define`, i.e. the call to the C++ constructor happens in
17
15
// createHasVirtualBase(), not some later function.
18
16
// ITANIUM_ARM-NOT: define
19
17
// Note `this` return type.
20
- // ITANIUM_ARM: call %struct.HasVirtualBase* @_ZN14HasVirtualBaseC1E7ArgType(%struct.HasVirtualBase* %{{[0-9]+}}, [1 x i32] %{{[0-9]+}})
18
+ // ITANIUM_ARM: call void @_ZN14HasVirtualBaseC1E7ArgType(%struct.HasVirtualBase* %{{[0-9]+}}, i64 %{{[0-9]+}})
21
19
return HasVirtualBase ( ArgType ( ) )
22
20
}
23
21
24
22
public func createImplicitDefaultConstructor( ) -> ImplicitDefaultConstructor {
25
- // ITANIUM_ARM: define protected swiftcc i32 @"$s7MySwift32createImplicitDefaultConstructorSo0bcD0VyF "()
23
+ // ITANIUM_ARM: define protected swiftcc i32 @"$s7MySwift32createImplicitDefaultConstructorSo0deF0VyF "()
26
24
// ITANIUM_ARM-NOT: define
27
25
// Note `this` return type.
28
- // ITANIUM_ARM: call %struct.ImplicitDefaultConstructor* @_ZN26ImplicitDefaultConstructorC2Ev(%struct.ImplicitDefaultConstructor* %{{[0-9]+}})
26
+ // ITANIUM_ARM: call void @_ZN26ImplicitDefaultConstructorC2Ev(%struct.ImplicitDefaultConstructor* %{{[0-9]+}})
29
27
return ImplicitDefaultConstructor ( )
30
28
}
31
29
@@ -35,10 +33,10 @@ public func createStructWithSubobjectCopyConstructorAndValue() {
35
33
// ITANIUM_ARM: [[OBJ:%.*]] = alloca %TSo42StructWithSubobjectCopyConstructorAndValueV
36
34
// ITANIUM_ARM: [[TMP:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV
37
35
// ITANIUM_ARM: [[MEMBER_AS_STRUCT:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[MEMBER]] to %struct.StructWithCopyConstructorAndValue*
38
- // ITANIUM_ARM: call %struct.StructWithCopyConstructorAndValue* @_ZN33StructWithCopyConstructorAndValueC2Ev(%struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT]])
36
+ // ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2Ev(%struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT]])
39
37
// ITANIUM_ARM: [[TMP_STRUCT:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[TMP]] to %struct.StructWithCopyConstructorAndValue*
40
38
// ITANIUM_ARM: [[MEMBER_AS_STRUCT_2:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[MEMBER]] to %struct.StructWithCopyConstructorAndValue*
41
- // ITANIUM_ARM: call %struct.StructWithCopyConstructorAndValue* @_ZN33StructWithCopyConstructorAndValueC2ERKS_(%struct.StructWithCopyConstructorAndValue* [[TMP_STRUCT]], %struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT_2]])
39
+ // ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2ERKS_(%struct.StructWithCopyConstructorAndValue* [[TMP_STRUCT]], %struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT_2]])
42
40
// ITANIUM_ARM: ret void
43
41
let member = StructWithCopyConstructorAndValue ( )
44
42
let obj = StructWithSubobjectCopyConstructorAndValue ( member: member)
@@ -47,11 +45,11 @@ public func createStructWithSubobjectCopyConstructorAndValue() {
47
45
public func createTemplatedConstructor( ) {
48
46
// ITANIUM_ARM-LABEL: define protected swiftcc void @"$s7MySwift26createTemplatedConstructoryyF"()
49
47
// ITANIUM_ARM: [[OBJ:%.*]] = alloca %TSo20TemplatedConstructorV
50
- // ITANIUM_ARM: [[IVAL:%.*]] = load [1 x i32], [1 x i32] *
48
+ // ITANIUM_ARM: [[IVAL:%.*]] = load i64, i64 *
51
49
// ITANIUM_ARM: [[OBJ_AS_STRUCT:%.*]] = bitcast %TSo20TemplatedConstructorV* [[OBJ]] to %struct.TemplatedConstructor*
52
- // ITANIUM_ARM: call %struct.TemplatedConstructor* @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* [[OBJ_AS_STRUCT]], [1 x i32] [[IVAL]])
50
+ // ITANIUM_ARM: call void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* [[OBJ_AS_STRUCT]], i64 [[IVAL]])
53
51
// ITANIUM_ARM: ret void
54
52
55
- // ITANIUM_ARM-LABEL: define {{.*}}%struct.TemplatedConstructor* @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* {{.*}}, [1 x i32] {{.*}})
53
+ // ITANIUM_ARM-LABEL: define {{.*}}void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* {{.*}}, i64 {{.*}})
56
54
let templated = TemplatedConstructor ( ArgType ( ) )
57
55
}
0 commit comments