Skip to content

Commit 076e9e0

Browse files
committed
[android][test] Fix or disable the remaining failing tests on the Android CI
1 parent 8e27947 commit 076e9e0

16 files changed

+45
-29
lines changed

test/AutoDiff/SILOptimizer/vjp_inlining.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import _Differentiation
1010
#if canImport(Glibc)
1111
import Glibc
12+
#elseif canImport(Android)
13+
import Android
1214
#else
1315
import Foundation
1416
#endif

test/ClangImporter/cfuncs_parse.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func test_pow() {
6868
}
6969

7070
// https://github.com/apple/swift/issues/51573
71-
// long doubles in AAPCS64 are 128 bits, which is not supported by
72-
// Swift, so don't test this.
73-
#if !((os(Android) || os(Linux)) && arch(arm64))
71+
// long doubles in AAPCS64 and 64-bit Android are 128 bits, which is not
72+
// supported by Swift, so don't test this.
73+
#if !((os(Android) && _pointerBitWidth(_64)) || (os(Linux) && arch(arm64)))
7474
func test_powl() {
7575
powl(1.5, 2.5)
7676
}

test/Frontend/embed-bitcode.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// UNSUPPORTED: OS=freebsd
1111
// UNSUPPORTED: OS=openbsd
1212
// UNSUPPORTED: OS=windows-msvc
13+
// UNSUPPORTED: OS=linux-android
1314

1415
// MARKER: Contents of (__LLVM,__bitcode) section
1516
// MARKER-NEXT: 00

test/IRGen/condfail.sil

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -primary-file %s -O -g -S | %FileCheck %s --check-prefix CHECK --check-prefix CHECK-%target-cpu --check-prefix CHECK-OPT-%target-os
1+
// RUN: %target-swift-frontend -primary-file %s -O -g -S | %FileCheck %s --check-prefix CHECK --check-prefix CHECK-%target-cpu --check-prefix CHECK-OPT-%target-os --check-prefix CHECK-OPT-%target-os-%target-cpu
22
// RUN: %target-swift-frontend -primary-file %s -g -S | %FileCheck %s --check-prefix CHECK --check-prefix CHECK-%target-cpu --check-prefix CHECK-NOOPT-%target-os
33

44
import Builtin
@@ -25,8 +25,10 @@ import Swift
2525
// CHECK-OPT-windows: ##NO_APP
2626
// CHECK-OPT-linux-androideabi: @APP
2727
// CHECK-OPT-linux-androideabi: @NO_APP
28-
// CHECK-OPT-linux-android: //APP
29-
// CHECK-OPT-linux-android: //NO_APP
28+
// CHECK-OPT-linux-android-aarch64: //APP
29+
// CHECK-OPT-linux-android-aarch64: //NO_APP
30+
// CHECK-OPT-linux-android-x86_64: #APP
31+
// CHECK-OPT-linux-android-x86_64: #NO_APP
3032
// CHECK-NOOPT-macosx-NOT: InlineAsm Start
3133
// CHECK-NOOPT-macosx-NOT: InlineAsm End
3234
// CHECK-NOOPT-linux-NOT: ##APP
@@ -35,8 +37,10 @@ import Swift
3537
// CHECK-NOOPT-windows-NOT: ##NO_APP
3638
// CHECK-OPT-linux-androideabi-NOT: @APP
3739
// CHECK-OPT-linux-androideabi-NOT: @NO_APP
38-
// CHECK-OPT-linux-android-NOT: //APP
39-
// CHECK-OPT-linux-android-NOT: //NO_APP
40+
// CHECK-OPT-linux-android-aarch64-NOT: //APP
41+
// CHECK-OPT-linux-android-aarch64-NOT: //NO_APP
42+
// CHECK-OPT-linux-android-x86_64-NOT: #APP
43+
// CHECK-OPT-linux-android-x86_64-NOT: #NO_APP
4044
// CHECK-x86_64: ud2
4145
// CHECK-i386: ud2
4246
// CHECK-arm64: brk

test/IRGen/framepointer.sil

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK --check-prefix=CHECK-%target-abi
1+
// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK --check-prefix=CHECK-%target-abi-%target-os
22
// RUN: %target-swift-frontend -primary-file %s -emit-ir -Xcc -mno-omit-leaf-frame-pointer | %FileCheck %s -check-prefix CHECK-ALL --check-prefix=CHECK-%target-abi-ALL
33
// RUN: %target-swift-frontend -primary-file %s -S | %FileCheck %s --check-prefix=CHECKASM --check-prefix=CHECKASM-%target-os-%target-cpu
44
// RUN: %target-swift-frontend -primary-file %s -emit-ir -Xcc -momit-leaf-frame-pointer | %FileCheck %s -check-prefix LEAF --check-prefix=LEAF-%target-abi
@@ -33,7 +33,9 @@ entry(%i : $Int32):
3333
// CHECK: ret i32 %1
3434
// CHECK: }
3535

36-
// CHECK-SYSV: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all"
36+
// CHECK-SYSV-macosx: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all"
37+
// CHECK-SYSV-linux-gnu: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all"
38+
// CHECK-SYSV-linux-android: attributes [[ATTR]] = { {{.*}}"frame-pointer"="non-leaf"
3739
// CHECK-WIN: attributes [[ATTR]] = { {{.*}}
3840

3941
// CHECK-ALL: define{{.*}} swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) [[ATTR:#.*]] {

test/IRGen/lto_autolink.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ import AutolinkElfCPragma
4343
import AutolinkModuleMapLink
4444
#endif
4545

46-
// UNSUPPORTED: OS=macosx && CPU=arm64
4746
// UNSUPPORTED: OS=ios && CPU=arm64e
4847
// UNSUPPORTED: OS=watchos && (CPU=arm64_32 || CPU=armv7k)
49-
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
48+
// XFAIL: OS=linux-android && CPU=aarch64
5049
// UNSUPPORTED: CPU=wasm32

test/IRGen/pic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// platforms.
33

44
// https://github.com/apple/swift/issues/54619
5-
// XFAIL: OS=linux-android, CPU=aarch64
5+
// XFAIL: OS=linux-android && CPU=aarch64
66
// UNSUPPORTED: OS=linux-gnu, CPU=wasm32
77

88
// RUN: %target-swift-frontend %s -module-name main -S -o - | %FileCheck -check-prefix=%target-cpu -check-prefix=%target-cpu-%target-sdk-name %s

test/IRGen/static_initializer.sil

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
// REQUIRES: CPU=arm64 || CPU=x86_64
44

5+
// Android x86_64 doesn't expose Float80.
6+
// XFAIL: OS=linux-android && CPU=x86_64
7+
58
// Generated from
69
// var x : Int32 = 2
710
// public func f() -> Int32 { return x }

test/Interop/Cxx/class/closure-thunk-irgen.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public func testClosureToBlock() {
2323
// CHECK: define internal void @"$s4main20testClosureToFuncPtryyFySo10NonTrivialVcfU_To"(ptr %[[V0:.*]])
2424
// CHECK: %[[V1:.*]] = alloca %{{.*}}, align 8
2525
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V1]])
26-
// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialC1ERKS_(ptr %[[V1]], ptr %[[V0]])
26+
// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialC{{1|2}}ERKS_(ptr %[[V1]], ptr %[[V0]])
2727
// CHECK-NEXT: call swiftcc void @"$s4main20testClosureToFuncPtryyFySo10NonTrivialVcfU_"(ptr noalias dereferenceable(8) %[[V1]])
28-
// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialD1Ev(ptr %[[V1]])
28+
// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V1]])
2929
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V1]])
3030
// CHECK-NEXT: ret void
3131

@@ -41,7 +41,7 @@ public func testClosureToFuncPtrReturnNonTrivial() {
4141
cfuncReturnNonTrivial2({() -> NonTrivial in return NonTrivial()});
4242
}
4343

44-
// CHECK: define swiftcc { ptr, ptr } @"$s4main13returnFuncPtrySo10NonTrivialVcyF"()
44+
// CHECK: define{{( protected)?}} swiftcc { ptr, ptr } @"$s4main13returnFuncPtrySo10NonTrivialVcyF"()
4545
// CHECK: %[[V0:.*]] = call ptr @_Z8getFnPtrv()
4646
// CHECK: %[[V1:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%{{.*}}, ptr @{{.*}}, i32 0, i32 2), i64 24, i64 7)
4747
// CHECK: %[[V2:.*]] = getelementptr inbounds{{.*}} <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1
@@ -52,12 +52,12 @@ public func testClosureToFuncPtrReturnNonTrivial() {
5252
// CHECK: define linkonce_odr hidden swiftcc void @"$sSo10NonTrivialVIetCX_ABIegn_TR"(ptr noalias dereferenceable(8) %[[V0:.*]], ptr %[[V1:.*]])
5353
// CHECK: %[[V2:.*]] = alloca %{{.*}}, align 8
5454
// CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V2]])
55-
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialC1ERKS_(ptr %[[V2]], ptr %[[V0]])
55+
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialC{{1|2}}ERKS_(ptr %[[V2]], ptr %[[V0]])
5656
// CHECK: invoke void %[[V1]](ptr %[[V2]])
5757
// CHECK: to label %[[INVOKE_CONT:.*]] unwind label %{{.*}}
5858

5959
// CHECK: [[INVOKE_CONT]]:
60-
// CHECK-NEXT: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V2]])
60+
// CHECK-NEXT: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V2]])
6161
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V2]])
6262
// CHECK-NEXT: ret void
6363

test/Interop/Cxx/class/function-call-irgen.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
import Closure
66

7-
// CHECK: define swiftcc void @"$s4main14testNonTrivialyyF"()
7+
// CHECK: define{{( protected)?}} swiftcc void @"$s4main14testNonTrivialyyF"()
88
// CHECK: %[[V0:.*]] = alloca %{{.*}}, align 8
99
// CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V0]])
1010
// CHECK: call {{(void|ptr)}} @__swift_cxx_ctor_ZN10NonTrivialC1Ev(ptr %[[V0]])
1111
// CHECK: call void @_Z5cfunc10NonTrivial(ptr %[[V0]])
12-
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V0]])
12+
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V0]])
1313
// CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V0]])
1414
// CHECK: ret void
1515

1616
public func testNonTrivial() {
1717
cfunc(NonTrivial());
1818
}
1919

20-
// CHECK: define swiftcc void @"$s4main29testNonTrivialFunctionPointeryyF"()
20+
// CHECK: define{{( protected)?}} swiftcc void @"$s4main29testNonTrivialFunctionPointeryyF"()
2121
// CHECK: %[[F_DEBUG:.*]] = alloca ptr, align 8
2222
// CHECK: call void @llvm.memset.p0.i64(ptr align 8 %[[F_DEBUG]], i8 0, i64 8, i1 false)
2323
// CHECK: %[[V0:.*]] = alloca %{{.*}}, align 8
@@ -29,7 +29,7 @@ public func testNonTrivial() {
2929
// CHECK: to label %[[INVOKE_CONT:.*]] unwind label %{{.*}}
3030

3131
// CHECK: [[INVOKE_CONT]]:
32-
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V0]])
32+
// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V0]])
3333
// CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V0]])
3434
// CHECK: ret void
3535

test/Interop/Cxx/stdlib/std-span-interface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// REQUIRES: swift_feature_SafeInteropWrappers
66

77
// FIXME swift-ci linux tests do not support std::span
8-
// UNSUPPORTED: OS=linux-gnu
8+
// UNSUPPORTED: OS=linux-gnu, OS=linux-android, OS=linux-androideabi
99

1010
#if !BRIDGING_HEADER
1111
import StdSpan

test/Parse/enum_floating_point_raw_value.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
// REQUIRES: CPU=i386 || CPU=x86_64
77

8-
// Windows does not support FP80
9-
// XFAIL: OS=windows-msvc
8+
// Windows and Android do not support FP80
9+
// XFAIL: OS=windows-msvc, OS=linux-android
1010

1111
enum RawTypeWithFloatValues : Float { // expected-error {{'RawTypeWithFloatValues' declares raw type 'Float', but does not conform to RawRepresentable and conformance could not be synthesized}} expected-note {{add stubs for conformance}}
1212
case Northrup = 1.5

test/SIL/clang-function-types-android.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-sil -swift-version 5 -use-clang-function-types -experimental-print-full-convention -o - | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -Xllvm -sil-print-types -emit-sil -swift-version 5 -use-clang-function-types -experimental-print-full-convention -o - | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
22

33
// REQUIRES: OS=linux-android || OS=linux-androideabi
44

test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
22
//
33
// REQUIRES: CPU=i386 || CPU=x86_64
4-
// UNSUPPORTED: OS=windows-msvc
4+
// UNSUPPORTED: OS=windows-msvc, OS=linux-android
55
//
66
// These are tests for diagnostics produced by constant propagation pass
77
// on floating-point operations that are specific to x86 architectures,

test/lit.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2400,10 +2400,15 @@ def find_compiler_rt_libs():
24002400
# Next check for the old scheme 'clang/lib/<os-name>', ignoring
24012401
# any target environment which is currently part of 'run_os'.
24022402
path = make_path(base, run_os.split('-')[0])
2403+
2404+
# Check if the Android environment needs to be in the name.
2405+
env = ''
2406+
if run_os.startswith('linux-android'):
2407+
env = '-android'
24032408
if os.path.exists(path):
24042409
# We should then have the architecture in the name.
24052410
for lib in os.listdir(path):
2406-
match = re.match(r'(?:lib)?clang_rt\.(\w+)-' + run_cpu, lib)
2411+
match = re.match(r'(?:lib)?clang_rt\.(\w+)-' + run_cpu + env, lib)
24072412
if match:
24082413
libs[match[1]] = lib
24092414

test/stdlib/FloatingPointIR_FP80.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-build-swift -Ounchecked -emit-ir %s | %FileCheck -check-prefix=%target-cpu %s
44

55
// REQUIRES: CPU=i386 || CPU=x86_64
6-
// UNSUPPORTED: OS=windows-msvc
6+
// UNSUPPORTED: OS=windows-msvc, OS=linux-android
77

88
var globalFloat80 : Float80 = 0.0
99

0 commit comments

Comments
 (0)