Skip to content

Commit 1bc774b

Browse files
committed
[android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
Also, make the analogous change to swiftlang/swift-driver#1372, which gets the sanitizer tests working on Android again, and remove the lld_lto feature in the tests, which is now unused.
1 parent c2fc7ee commit 1bc774b

13 files changed

+24
-34
lines changed

lib/Driver/ToolChains.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1459,9 +1459,10 @@ void ToolChain::getClangLibraryPath(const ArgList &Args,
14591459
getResourceDirPath(LibPath, Args, /*Shared=*/true);
14601460
// Remove platform name.
14611461
llvm::sys::path::remove_filename(LibPath);
1462-
llvm::sys::path::append(LibPath, "clang", "lib",
1463-
T.isOSDarwin() ? "darwin"
1464-
: getPlatformNameForTriple(T));
1462+
StringRef platformName = "darwin";
1463+
if (!T.isOSDarwin())
1464+
platformName = T.isAndroid() ? "linux" : getPlatformNameForTriple(T);
1465+
llvm::sys::path::append(LibPath, "clang", "lib", platformName);
14651466
}
14661467

14671468
/// Get the runtime library link path, which is platform-specific and found

test/Driver/link-time-opt.swift

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// REQUIRES: lld_lto
2-
31
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift -lto=llvm-thin -target x86_64-unknown-linux-gnu | %FileCheck %s --check-prefix=CHECK-SIMPLE-THIN --check-prefix=CHECK-SIMPLE-THIN-linux-gnu
42
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift -lto=llvm-thin -target x86_64-unknown-windows-msvc | %FileCheck %s --check-prefix=CHECK-SIMPLE-THIN --check-prefix=CHECK-SIMPLE-THIN-windows-msvc
53

test/Driver/lto-output-mode-clash.swift

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// REQUIRES: lld_lto
2-
31
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift -lto=llvm-full -static -emit-library -target x86_64-apple-macosx10.9 | %FileCheck %s
42
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift -lto=llvm-full -emit-library -target x86_64-apple-macosx10.9 | %FileCheck %s
53
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift -lto=llvm-full -c -target x86_64-apple-macosx10.9 | %FileCheck %s

test/Driver/static-stdlib-linux-lld.swift

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Statically link a "hello world" program
22
// REQUIRES: OS=linux-gnu
33
// REQUIRES: static_stdlib
4-
// REQUIRES: lld_lto
54
print("hello world!")
65
// RUN: %empty-directory(%t)
76
// RUN: %target-swiftc_driver -static-stdlib -use-ld=lld %import-static-libdispatch -o %t/static-stdlib-lld %s

test/IRGen/section.swift

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
// ASM-NOT: .section
5252
// ASM: $s7section3fooyyF:
5353
// ASM-linux-gnu: .section{{.*}}__TEXT,__mysection
54+
// ASM-linux-android: .section{{.*}}__TEXT,__mysection
55+
// ASM-linux-androideabi: .section{{.*}}__TEXT,__mysection
5456
// ASM-NOT: .section
5557
// ASM: $s7section2g0Sivp:
5658
// ASM-NOT: .section

test/Interop/Cxx/class/constructors-copy-irgen-android.swift

+3-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ import Constructors
99
import TypeClassification
1010

1111
// ITANIUM_ARM-LABEL: define protected swiftcc void @"$s7MySwift35copyWithUserProvidedCopyConstructorySo03Has{{cdeF0V_ACtACF|efgH0V_ADtADF}}"
12-
// ITANIUM_ARM-SAME: (%TSo30HasUserProvidedCopyConstructorV* {{.*}}[[ARG0:%.*]], %TSo30HasUserProvidedCopyConstructorV* {{.*}}[[ARG1:%.*]], %TSo30HasUserProvidedCopyConstructorV* {{.*}}[[ARG2:%.*]])
13-
// ITANIUM_ARM: [[ARG0_AS_STRUCT:%.*]] = bitcast %TSo30HasUserProvidedCopyConstructorV* [[ARG0]] to %struct.HasUserProvidedCopyConstructor*
14-
// ITANIUM_ARM: [[ARG2_AS_STRUCT:%.*]] = bitcast %TSo30HasUserProvidedCopyConstructorV* [[ARG2]] to %struct.HasUserProvidedCopyConstructor*
15-
// ITANIUM_ARM: call void @_ZN30HasUserProvidedCopyConstructorC2ERKS_(%struct.HasUserProvidedCopyConstructor* [[ARG0_AS_STRUCT]], %struct.HasUserProvidedCopyConstructor* [[ARG2_AS_STRUCT]])
16-
// ITANIUM_ARM: [[ARG1_AS_STRUCT:%.*]] = bitcast %TSo30HasUserProvidedCopyConstructorV* [[ARG1]] to %struct.HasUserProvidedCopyConstructor*
17-
// ITANIUM_ARM: [[ARG2_AS_STRUCT:%.*]] = bitcast %TSo30HasUserProvidedCopyConstructorV* [[ARG2]] to %struct.HasUserProvidedCopyConstructor*
18-
// ITANIUM_ARM: call void @_ZN30HasUserProvidedCopyConstructorC2ERKS_(%struct.HasUserProvidedCopyConstructor* [[ARG1_AS_STRUCT]], %struct.HasUserProvidedCopyConstructor* [[ARG2_AS_STRUCT]])
12+
// ITANIUM_ARM-SAME: (ptr {{.*}}[[ARG0:%.*]], ptr {{.*}}[[ARG1:%.*]], ptr {{.*}}[[ARG2:%.*]])
13+
// ITANIUM_ARM: call void @_ZN30HasUserProvidedCopyConstructorC2ERKS_(ptr [[ARG0]], ptr [[ARG2]])
14+
// ITANIUM_ARM: call void @_ZN30HasUserProvidedCopyConstructorC2ERKS_(ptr [[ARG1]], ptr [[ARG2]])
1915
// ITANIUM_ARM: ret void
2016

2117
public func copyWithUserProvidedCopyConstructor(_ x: HasUserProvidedCopyConstructor)

test/Interop/Cxx/class/constructors-irgen-android.swift

+8-12
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import Constructors
99
import TypeClassification
1010

1111
public func createHasVirtualBase() -> HasVirtualBase {
12-
// ITANIUM_ARM: define protected swiftcc void @"$s7MySwift20createHasVirtualBaseSo0deF0VyF"(%TSo14HasVirtualBaseV* noalias nocapture sret({{.*}}) %0)
12+
// ITANIUM_ARM: define protected swiftcc void @"$s7MySwift20createHasVirtualBaseSo0deF0VyF"(ptr noalias nocapture sret({{.*}}) %0)
1313
// To verify that the thunk is inlined, make sure there's no intervening
1414
// `define`, i.e. the call to the C++ constructor happens in
1515
// createHasVirtualBase(), not some later function.
1616
// ITANIUM_ARM-NOT: define
1717
// Note `this` return type.
18-
// ITANIUM_ARM: call void @_ZN14HasVirtualBaseC1E7ArgType(%struct.HasVirtualBase* %{{[0-9]+}}, i64 %{{[0-9]+}})
18+
// ITANIUM_ARM: call void @_ZN14HasVirtualBaseC1E7ArgType(ptr %{{[0-9]+}}, i64 %{{[0-9]+}})
1919
return HasVirtualBase(ArgType())
2020
}
2121

2222
public func createImplicitDefaultConstructor() -> ImplicitDefaultConstructor {
2323
// ITANIUM_ARM: define protected swiftcc i32 @"$s7MySwift32createImplicitDefaultConstructorSo0deF0VyF"()
2424
// ITANIUM_ARM-NOT: define
2525
// Note `this` return type.
26-
// ITANIUM_ARM: call void @_ZN26ImplicitDefaultConstructorC2Ev(%struct.ImplicitDefaultConstructor* %{{[0-9]+}})
26+
// ITANIUM_ARM: call void @_ZN26ImplicitDefaultConstructorC2Ev(ptr %{{[0-9]+}})
2727
return ImplicitDefaultConstructor()
2828
}
2929

@@ -32,11 +32,8 @@ public func createStructWithSubobjectCopyConstructorAndValue() {
3232
// ITANIUM_ARM: [[MEMBER:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV
3333
// ITANIUM_ARM: [[OBJ:%.*]] = alloca %TSo42StructWithSubobjectCopyConstructorAndValueV
3434
// ITANIUM_ARM: [[TMP:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV
35-
// ITANIUM_ARM: [[MEMBER_AS_STRUCT:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[MEMBER]] to %struct.StructWithCopyConstructorAndValue*
36-
// ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2Ev(%struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT]])
37-
// ITANIUM_ARM: [[TMP_STRUCT:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[TMP]] to %struct.StructWithCopyConstructorAndValue*
38-
// ITANIUM_ARM: [[MEMBER_AS_STRUCT_2:%.*]] = bitcast %TSo33StructWithCopyConstructorAndValueV* [[MEMBER]] to %struct.StructWithCopyConstructorAndValue*
39-
// ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2ERKS_(%struct.StructWithCopyConstructorAndValue* [[TMP_STRUCT]], %struct.StructWithCopyConstructorAndValue* [[MEMBER_AS_STRUCT_2]])
35+
// ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2Ev(ptr [[MEMBER]])
36+
// ITANIUM_ARM: call void @_ZN33StructWithCopyConstructorAndValueC2ERKS_(ptr [[TMP]], ptr [[MEMBER]])
4037
// ITANIUM_ARM: ret void
4138
let member = StructWithCopyConstructorAndValue()
4239
let obj = StructWithSubobjectCopyConstructorAndValue(member: member)
@@ -45,11 +42,10 @@ public func createStructWithSubobjectCopyConstructorAndValue() {
4542
public func createTemplatedConstructor() {
4643
// ITANIUM_ARM-LABEL: define protected swiftcc void @"$s7MySwift26createTemplatedConstructoryyF"()
4744
// ITANIUM_ARM: [[OBJ:%.*]] = alloca %TSo20TemplatedConstructorV
48-
// ITANIUM_ARM: [[IVAL:%.*]] = load i64, i64*
49-
// ITANIUM_ARM: [[OBJ_AS_STRUCT:%.*]] = bitcast %TSo20TemplatedConstructorV* [[OBJ]] to %struct.TemplatedConstructor*
50-
// ITANIUM_ARM: call void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* [[OBJ_AS_STRUCT]], i64 [[IVAL]])
45+
// ITANIUM_ARM: [[IVAL:%.*]] = load i64, ptr
46+
// ITANIUM_ARM: call void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(ptr [[OBJ]], i64 [[IVAL]])
5147
// ITANIUM_ARM: ret void
5248

53-
// ITANIUM_ARM-LABEL: define {{.*}}void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(%struct.TemplatedConstructor* {{.*}}, i64 {{.*}})
49+
// ITANIUM_ARM-LABEL: define {{.*}}void @_ZN20TemplatedConstructorC2I7ArgTypeEET_(ptr {{.*}}, i64 {{.*}})
5450
let templated = TemplatedConstructor(ArgType())
5551
}

test/Interop/Cxx/class/copy-move-assignment-irgen.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public func copyAssign() {
2020
// CHECK: call {{void|ptr}} @{{_ZN31NonTrivialCopyAndCopyMoveAssignC1Ev|_ZN31NonTrivialCopyAndCopyMoveAssignC2Ev|"\?\?0NonTrivialCopyAndCopyMoveAssign@@QEAA@XZ"}}(ptr %[[COPY_INSTANCE:.*]])
2121
// CHECK: call {{void|ptr}} @{{_ZN31NonTrivialCopyAndCopyMoveAssignC1Ev|_ZN31NonTrivialCopyAndCopyMoveAssignC2Ev|"\?\?0NonTrivialCopyAndCopyMoveAssign@@QEAA@XZ"}}(ptr %[[COPY_INSTANCE2:.*]])
2222
// CHECK: call {{void|ptr}} @{{_ZN31NonTrivialCopyAndCopyMoveAssignD1Ev|_ZN31NonTrivialCopyAndCopyMoveAssignD2Ev|"\?\?1NonTrivialCopyAndCopyMoveAssign@@QEAA@XZ"}}(ptr %[[COPY_INSTANCE]])
23-
// CHECK: call {{void|ptr}} @{{_ZN31NonTrivialCopyAndCopyMoveAssignC1EOS_|_ZN31NonTrivialCopyAndCopyMoveAssignC2EOS_|_ZN31NonTrivialCopyAndCopyMoveAssignC1ERKS_Tm|_ZN31NonTrivialCopyAndCopyMoveAssignC2ERKS_Tm|"\?\?0NonTrivialCopyAndCopyMoveAssign@@QEAA@AEBU0@@Z"}}(
23+
// CHECK: call {{void|(noundef )?ptr}} @{{_ZN31NonTrivialCopyAndCopyMoveAssignC1EOS_|_ZN31NonTrivialCopyAndCopyMoveAssignC2EOS_|_ZN31NonTrivialCopyAndCopyMoveAssignC1ERKS_Tm|_ZN31NonTrivialCopyAndCopyMoveAssignC2ERKS_Tm|"\?\?0NonTrivialCopyAndCopyMoveAssign@@QEAA@AEBU0@@Z"}}(
2424
// CHECK-SAME: %[[COPY_INSTANCE]],
2525
// CHECK-SAME: ptr
2626
// CHECK-SAME: %[[COPY_INSTANCE2]])

test/Interop/Cxx/templates/class-template-non-type-parameter-irgen.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import ClassTemplateNonTypeParameter
55
let p = MagicIntPair()
66
let t = MagicIntTriple()
77

8-
// CHECK: @"${{s4main1pSo0034MagicArrayInt32_UInt_2_zoAFhhiEngcVvp|s4main1pSo0036MagicArrayInt32_UInt64_2_JsAEiFiuomcVvp}}"
9-
// CHECK: @"${{s4main1tSo0034MagicArrayInt32_UInt_3_zoAFhhiEngcVvp|s4main1tSo0036MagicArrayInt32_UInt64_3_JsAEiFiuomcVvp}}"
8+
// CHECK: @"${{s4main1pSo0034MagicArrayInt32_UInt_2_zoAFhhiEngcVvp|s4main1pSo0036MagicArrayInt32_UInt(64|32)_2_JsAEiFiuomcVvp}}"
9+
// CHECK: @"${{s4main1tSo0034MagicArrayInt32_UInt_3_zoAFhhiEngcVvp|s4main1tSo0036MagicArrayInt32_UInt(64|32)_3_JsAEiFiuomcVvp}}"

test/Interop/CxxToSwiftToCxx/bridge-cxx-struct-back-to-cxx.swift

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
// RUN: %target-interop-build-clangxx -fsyntax-only -x c++-header %t/full-cxx-swift-cxx-bridging.h -std=gnu++20 -c -fmodules -fcxx-modules -I %t
2222

23+
// XFAIL: OS=linux-android, OS=linux-androideabi
24+
2325
//--- header.h
2426

2527
struct Trivial {

test/Interpreter/llvm_link_time_opt.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// UNSUPPORTED: OS=windows-msvc
22
// static library is not well supported yet on Windows
33

4-
// REQUIRES: lld_lto
4+
// XFAIL: OS=linux-android, OS=linux-androideabi
55

66
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
77
// ASan cannot work in ("Interceptors are not working, AddressSanitizer is

test/Reflection/conformance_descriptors.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// CHECK: CONFORMANCES:
1515
// CHECK: =============
16-
// CHECK-DAG: 16ConformanceCheck10SomeStructV6${{[0-9a-f]*}}yXZ0c6NestedD06${{[0-9a-f]*}}LLV (ConformanceCheck.SomeStruct.(unknown context at ${{[0-9a-f]*}}).(SomeNestedStruct in ${{[0-9a-f]*}})) : ConformanceCheck.MyProto
16+
// CHECK-DAG: 16ConformanceCheck10SomeStructV{{[56]}}${{[0-9a-f]*}}yXZ0c6NestedD0{{[56]}}${{[0-9a-f]*}}LLV (ConformanceCheck.SomeStruct.(unknown context at ${{[0-9a-f]*}}).(SomeNestedStruct in ${{[0-9a-f]*}})) : ConformanceCheck.MyProto
1717
// CHECK-DAG: 16ConformanceCheck3fooV3barV3bazV3quxV4quuxV5corgeV6graultV6garplyV5waldoV4fredV5plughV5xyzzyV4thudV18SomeConformingTypeV (ConformanceCheck.foo.bar.baz.qux.quux.corge.grault.garply.waldo.fred.plugh.xyzzy.thud.SomeConformingType) : ConformanceCheck.MyProto
1818
// CHECK-DAG: 16ConformanceCheck7StructAV (ConformanceCheck.StructA) : ConformanceCheck.MyProto, Swift.Hashable, Swift.Equatable
1919
// CHECK-DAG: 16ConformanceCheck2E4O (ConformanceCheck.E4) : ConformanceCheck.P1, ConformanceCheck.P2, ConformanceCheck.P3

test/lit.cfg

-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ backtrace_on_crash = lit_config.params.get('backtrace_on_crash', None)
496496
if backtrace_on_crash is not None:
497497
config.environment['SWIFT_BACKTRACE'] = 'enable=on'
498498

499-
config.available_features.add('lld_lto')
500-
501499
threading = lit_config.params.get('threading', 'none')
502500
config.available_features.add('threading_{}'.format(threading))
503501
if threading != "none":

0 commit comments

Comments
 (0)