From 6611ea97e945ccf575198ebfdf5eb746b18dd0c5 Mon Sep 17 00:00:00 2001 From: finagolfin Date: Sat, 17 May 2025 13:27:33 +0530 Subject: [PATCH 1/7] [android][test] Fix or disable the remaining failing tests on the Android CI (#81398) Also, fix and enable `IRGen/lto_autolink` for all non-Wasm targets and `IRGen/static_initializer` for aarch64. This should get [the community Android CI](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-build/) green [again](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/). --- test/AutoDiff/SILOptimizer/vjp_inlining.swift | 2 ++ test/ClangImporter/cfuncs_parse.swift | 6 +++--- test/Frontend/embed-bitcode.swift | 10 +--------- test/IRGen/condfail.sil | 14 +++++++++----- test/IRGen/framepointer.sil | 7 +++++-- test/IRGen/lto_autolink.swift | 8 ++------ test/IRGen/pic.swift | 2 +- test/IRGen/static_initializer.sil | 5 ++++- test/Interop/Cxx/class/closure-thunk-irgen.swift | 10 +++++----- test/Interop/Cxx/class/function-call-irgen.swift | 8 ++++---- test/Interop/Cxx/stdlib/std-span-interface.swift | 2 +- test/Parse/enum_floating_point_raw_value.swift | 4 ++-- test/SIL/clang-function-types-android.swift | 2 +- ...iagnostic_constant_propagation_floats_x86.swift | 4 +++- test/lit.cfg | 7 ++++++- test/stdlib/FloatingPointIR_FP80.swift | 4 +++- 16 files changed, 52 insertions(+), 43 deletions(-) diff --git a/test/AutoDiff/SILOptimizer/vjp_inlining.swift b/test/AutoDiff/SILOptimizer/vjp_inlining.swift index 9f839a6c3afa2..6cc8aa75644f2 100644 --- a/test/AutoDiff/SILOptimizer/vjp_inlining.swift +++ b/test/AutoDiff/SILOptimizer/vjp_inlining.swift @@ -9,6 +9,8 @@ import _Differentiation #if canImport(Glibc) import Glibc +#elseif canImport(Android) +import Android #else import Foundation #endif diff --git a/test/ClangImporter/cfuncs_parse.swift b/test/ClangImporter/cfuncs_parse.swift index d5e4390da11b4..f2ca15c0876a5 100644 --- a/test/ClangImporter/cfuncs_parse.swift +++ b/test/ClangImporter/cfuncs_parse.swift @@ -68,9 +68,9 @@ func test_pow() { } // https://github.com/apple/swift/issues/51573 -// long doubles in AAPCS64 are 128 bits, which is not supported by -// Swift, so don't test this. -#if !((os(Android) || os(Linux)) && arch(arm64)) +// long doubles in AAPCS64 and 64-bit Android are 128 bits, which is not +// supported by Swift, so don't test this. +#if !((os(Android) && _pointerBitWidth(_64)) || (os(Linux) && arch(arm64))) func test_powl() { powl(1.5, 2.5) } diff --git a/test/Frontend/embed-bitcode.swift b/test/Frontend/embed-bitcode.swift index 9f59002b56109..e16c7b7180e5f 100644 --- a/test/Frontend/embed-bitcode.swift +++ b/test/Frontend/embed-bitcode.swift @@ -1,16 +1,8 @@ -// REQUIRES: CPU=x86_64 +// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchos, CPU=x86_64 // RUN: %target-swift-frontend -c -module-name someModule -embed-bitcode-marker -o %t.o %s // RUN: llvm-objdump --macho --section="__LLVM,__bitcode" %t.o | %FileCheck -check-prefix=MARKER %s // RUN: llvm-objdump --macho --section="__LLVM,__swift_cmdline" %t.o | %FileCheck -check-prefix=MARKER-CMD %s -// This file tests Mach-O file output, but Linux variants do not produce Mach-O -// files. -// UNSUPPORTED: OS=linux-gnu -// UNSUPPORTED: OS=linux-gnueabihf -// UNSUPPORTED: OS=freebsd -// UNSUPPORTED: OS=openbsd -// UNSUPPORTED: OS=windows-msvc - // MARKER: Contents of (__LLVM,__bitcode) section // MARKER-NEXT: 00 // MARKER-CMD: Contents of (__LLVM,__swift_cmdline) section diff --git a/test/IRGen/condfail.sil b/test/IRGen/condfail.sil index 3b48901a82da1..6ac3eab8b0c06 100644 --- a/test/IRGen/condfail.sil +++ b/test/IRGen/condfail.sil @@ -1,4 +1,4 @@ -// 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 +// 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 // 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 import Builtin @@ -25,8 +25,10 @@ import Swift // CHECK-OPT-windows: ##NO_APP // CHECK-OPT-linux-androideabi: @APP // CHECK-OPT-linux-androideabi: @NO_APP -// CHECK-OPT-linux-android: //APP -// CHECK-OPT-linux-android: //NO_APP +// CHECK-OPT-linux-android-aarch64: //APP +// CHECK-OPT-linux-android-aarch64: //NO_APP +// CHECK-OPT-linux-android-x86_64: #APP +// CHECK-OPT-linux-android-x86_64: #NO_APP // CHECK-NOOPT-macosx-NOT: InlineAsm Start // CHECK-NOOPT-macosx-NOT: InlineAsm End // CHECK-NOOPT-linux-NOT: ##APP @@ -35,8 +37,10 @@ import Swift // CHECK-NOOPT-windows-NOT: ##NO_APP // CHECK-OPT-linux-androideabi-NOT: @APP // CHECK-OPT-linux-androideabi-NOT: @NO_APP -// CHECK-OPT-linux-android-NOT: //APP -// CHECK-OPT-linux-android-NOT: //NO_APP +// CHECK-OPT-linux-android-aarch64-NOT: //APP +// CHECK-OPT-linux-android-aarch64-NOT: //NO_APP +// CHECK-OPT-linux-android-x86_64-NOT: #APP +// CHECK-OPT-linux-android-x86_64-NOT: #NO_APP // CHECK-x86_64: ud2 // CHECK-i386: ud2 // CHECK-arm64: brk diff --git a/test/IRGen/framepointer.sil b/test/IRGen/framepointer.sil index 2ef0a5c2b7f6a..14054a9e7bd49 100644 --- a/test/IRGen/framepointer.sil +++ b/test/IRGen/framepointer.sil @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK --check-prefix=CHECK-%target-abi +// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK --check-prefix=CHECK-%target-abi --check-prefix=CHECK-%target-abi-%target-os // 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 // RUN: %target-swift-frontend -primary-file %s -S | %FileCheck %s --check-prefix=CHECKASM --check-prefix=CHECKASM-%target-os-%target-cpu // 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,10 @@ entry(%i : $Int32): // CHECK: ret i32 %1 // CHECK: } -// CHECK-SYSV: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all" +// CHECK-SYSV: Function Attrs: +// CHECK-SYSV-macosx: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all" +// CHECK-SYSV-linux-gnu: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all" +// CHECK-SYSV-linux-android: attributes [[ATTR]] = { {{.*}}"frame-pointer"="non-leaf" // CHECK-WIN: attributes [[ATTR]] = { {{.*}} // CHECK-ALL: define{{.*}} swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) [[ATTR:#.*]] { diff --git a/test/IRGen/lto_autolink.swift b/test/IRGen/lto_autolink.swift index 9a9ba4b576e23..ccf196e5bf167 100644 --- a/test/IRGen/lto_autolink.swift +++ b/test/IRGen/lto_autolink.swift @@ -28,8 +28,8 @@ import empty // RUN: %target-swift-frontend -target %target-cpu-unknown-linux-gnu -emit-module -parse-stdlib -o %t -module-name empty -module-link-name empty %S/../Inputs/empty.swift -// RUN: %target-swift-emit-ir -target %target-cpu-unknown-linux-gnu -lto=llvm-full -parse-stdlib -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-ELF-MERGE -// RUN: %target-swift-emit-ir -target %target-cpu-unknown-linux-gnu -lto=llvm-thin -parse-stdlib -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-ELF-MERGE +// RUN: %target-swift-emit-ir -target %target-cpu-unknown-linux-gnu -lto=llvm-full -parse-stdlib -nostdimport -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-ELF-MERGE +// RUN: %target-swift-emit-ir -target %target-cpu-unknown-linux-gnu -lto=llvm-thin -parse-stdlib -nostdimport -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-ELF-MERGE // CHECK-ELF-MERGE-DAG: !llvm.dependent-libraries = !{ // CHECK-ELF-MERGE-DAG: !{{[0-9]+}} = !{!"empty"} @@ -43,8 +43,4 @@ import AutolinkElfCPragma import AutolinkModuleMapLink #endif -// UNSUPPORTED: OS=macosx && CPU=arm64 -// UNSUPPORTED: OS=ios && CPU=arm64e -// UNSUPPORTED: OS=watchos && (CPU=arm64_32 || CPU=armv7k) -// UNSUPPORTED: OS=linux-gnu && CPU=aarch64 // UNSUPPORTED: CPU=wasm32 diff --git a/test/IRGen/pic.swift b/test/IRGen/pic.swift index db29b347255d3..b5160b2bfd701 100644 --- a/test/IRGen/pic.swift +++ b/test/IRGen/pic.swift @@ -2,7 +2,7 @@ // platforms. // https://github.com/apple/swift/issues/54619 -// XFAIL: OS=linux-android, CPU=aarch64 +// XFAIL: OS=linux-android && CPU=aarch64 // UNSUPPORTED: OS=linux-gnu, CPU=wasm32 // RUN: %target-swift-frontend %s -module-name main -S -o - | %FileCheck -check-prefix=%target-cpu -check-prefix=%target-cpu-%target-sdk-name %s diff --git a/test/IRGen/static_initializer.sil b/test/IRGen/static_initializer.sil index d4cb6849cff87..730d89211eb48 100644 --- a/test/IRGen/static_initializer.sil +++ b/test/IRGen/static_initializer.sil @@ -1,6 +1,9 @@ // RUN: %target-swift-frontend %s -emit-ir | %FileCheck %s -check-prefix CHECK -check-prefix CHECK-%target-abi -check-prefix CHECK-%target-abi-%target-cpu -// REQUIRES: CPU=arm64 || CPU=x86_64 +// REQUIRES: CPU=aarch64 || CPU=arm64 || CPU=x86_64 + +// Android x86_64 doesn't expose Float80. +// UNSUPPORTED: OS=linux-android && CPU=x86_64 // Generated from // var x : Int32 = 2 diff --git a/test/Interop/Cxx/class/closure-thunk-irgen.swift b/test/Interop/Cxx/class/closure-thunk-irgen.swift index 7745b4364d798..1c137716656a3 100644 --- a/test/Interop/Cxx/class/closure-thunk-irgen.swift +++ b/test/Interop/Cxx/class/closure-thunk-irgen.swift @@ -23,9 +23,9 @@ public func testClosureToBlock() { // CHECK: define internal void @"$s4main20testClosureToFuncPtryyFySo10NonTrivialVcfU_To"(ptr %[[V0:.*]]) // CHECK: %[[V1:.*]] = alloca %{{.*}}, align 8 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V1]]) -// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialC1ERKS_(ptr %[[V1]], ptr %[[V0]]) +// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialC{{1|2}}ERKS_(ptr %[[V1]], ptr %[[V0]]) // CHECK-NEXT: call swiftcc void @"$s4main20testClosureToFuncPtryyFySo10NonTrivialVcfU_"(ptr noalias dereferenceable(8) %[[V1]]) -// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialD1Ev(ptr %[[V1]]) +// CHECK-NEXT: call {{void|ptr}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V1]]) // CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V1]]) // CHECK-NEXT: ret void @@ -41,7 +41,7 @@ public func testClosureToFuncPtrReturnNonTrivial() { cfuncReturnNonTrivial2({() -> NonTrivial in return NonTrivial()}); } -// CHECK: define swiftcc { ptr, ptr } @"$s4main13returnFuncPtrySo10NonTrivialVcyF"() +// CHECK: define{{( protected)?}} swiftcc { ptr, ptr } @"$s4main13returnFuncPtrySo10NonTrivialVcyF"() // CHECK: %[[V0:.*]] = call ptr @_Z8getFnPtrv() // CHECK: %[[V1:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%{{.*}}, ptr @{{.*}}, i32 0, i32 2), i64 24, i64 7) // CHECK: %[[V2:.*]] = getelementptr inbounds <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1 @@ -52,12 +52,12 @@ public func testClosureToFuncPtrReturnNonTrivial() { // CHECK: define linkonce_odr hidden swiftcc void @"$sSo10NonTrivialVIetCX_ABIegn_TR"(ptr noalias dereferenceable(8) %[[V0:.*]], ptr %[[V1:.*]]) // CHECK: %[[V2:.*]] = alloca %{{.*}}, align 8 // CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V2]]) -// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialC1ERKS_(ptr %[[V2]], ptr %[[V0]]) +// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialC{{1|2}}ERKS_(ptr %[[V2]], ptr %[[V0]]) // CHECK: invoke void %[[V1]](ptr %[[V2]]) // CHECK: to label %[[INVOKE_CONT:.*]] unwind label %{{.*}} // CHECK: [[INVOKE_CONT]]: -// CHECK-NEXT: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V2]]) +// CHECK-NEXT: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V2]]) // CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V2]]) // CHECK-NEXT: ret void diff --git a/test/Interop/Cxx/class/function-call-irgen.swift b/test/Interop/Cxx/class/function-call-irgen.swift index c2d45e7ddf39a..acba58ed69b98 100644 --- a/test/Interop/Cxx/class/function-call-irgen.swift +++ b/test/Interop/Cxx/class/function-call-irgen.swift @@ -4,12 +4,12 @@ import Closure -// CHECK: define swiftcc void @"$s4main14testNonTrivialyyF"() +// CHECK: define{{( protected)?}} swiftcc void @"$s4main14testNonTrivialyyF"() // CHECK: %[[V0:.*]] = alloca %{{.*}}, align 8 // CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[V0]]) // CHECK: call {{(void|ptr)}} @__swift_cxx_ctor_ZN10NonTrivialC1Ev(ptr %[[V0]]) // CHECK: call void @_Z5cfunc10NonTrivial(ptr %[[V0]]) -// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V0]]) +// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V0]]) // CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V0]]) // CHECK: ret void @@ -17,7 +17,7 @@ public func testNonTrivial() { cfunc(NonTrivial()); } -// CHECK: define swiftcc void @"$s4main29testNonTrivialFunctionPointeryyF"() +// CHECK: define{{( protected)?}} swiftcc void @"$s4main29testNonTrivialFunctionPointeryyF"() // CHECK: %[[F_DEBUG:.*]] = alloca ptr, align 8 // CHECK: call void @llvm.memset.p0.i64(ptr align 8 %[[F_DEBUG]], i8 0, i64 8, i1 false) // CHECK: %[[V0:.*]] = alloca %{{.*}}, align 8 @@ -29,7 +29,7 @@ public func testNonTrivial() { // CHECK: to label %[[INVOKE_CONT:.*]] unwind label %{{.*}} // CHECK: [[INVOKE_CONT]]: -// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD1Ev(ptr %[[V0]]) +// CHECK: call {{(void|ptr)}} @_ZN10NonTrivialD{{1|2}}Ev(ptr %[[V0]]) // CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[V0]]) // CHECK: ret void diff --git a/test/Interop/Cxx/stdlib/std-span-interface.swift b/test/Interop/Cxx/stdlib/std-span-interface.swift index 436c9fd1070a8..891a715f67c1a 100644 --- a/test/Interop/Cxx/stdlib/std-span-interface.swift +++ b/test/Interop/Cxx/stdlib/std-span-interface.swift @@ -9,7 +9,7 @@ // REQUIRES: swift_feature_LifetimeDependence // FIXME swift-ci linux tests do not support std::span -// UNSUPPORTED: OS=linux-gnu +// UNSUPPORTED: OS=linux-gnu, OS=linux-android, OS=linux-androideabi #if !BRIDGING_HEADER import StdSpan diff --git a/test/Parse/enum_floating_point_raw_value.swift b/test/Parse/enum_floating_point_raw_value.swift index 8444770d30ac4..27fd8a8724aff 100644 --- a/test/Parse/enum_floating_point_raw_value.swift +++ b/test/Parse/enum_floating_point_raw_value.swift @@ -5,8 +5,8 @@ // REQUIRES: CPU=i386 || CPU=x86_64 -// Windows does not support FP80 -// XFAIL: OS=windows-msvc +// Windows and Android do not support FP80 +// UNSUPPORTED: OS=windows-msvc, OS=linux-android 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}} case Northrup = 1.5 diff --git a/test/SIL/clang-function-types-android.swift b/test/SIL/clang-function-types-android.swift index 1d5d82baff56f..0685eba73c44a 100644 --- a/test/SIL/clang-function-types-android.swift +++ b/test/SIL/clang-function-types-android.swift @@ -1,4 +1,4 @@ -// 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 +// 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 // REQUIRES: OS=linux-android || OS=linux-androideabi diff --git a/test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift b/test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift index 6411c9aa5b972..8cdcc90e4aa37 100644 --- a/test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift +++ b/test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift @@ -1,7 +1,9 @@ // RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify // // REQUIRES: CPU=i386 || CPU=x86_64 -// UNSUPPORTED: OS=windows-msvc +// +// Windows and Android do not expose Float80. +// UNSUPPORTED: OS=windows-msvc, OS=linux-android // // These are tests for diagnostics produced by constant propagation pass // on floating-point operations that are specific to x86 architectures, diff --git a/test/lit.cfg b/test/lit.cfg index 061f2947e6bcf..4250ee522f12f 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2400,10 +2400,15 @@ def find_compiler_rt_libs(): # Next check for the old scheme 'clang/lib/', ignoring # any target environment which is currently part of 'run_os'. path = make_path(base, run_os.split('-')[0]) + + # Check if the Android environment needs to be in the name. + env = '' + if run_os.startswith('linux-android'): + env = '-android' if os.path.exists(path): # We should then have the architecture in the name. for lib in os.listdir(path): - match = re.match(r'(?:lib)?clang_rt\.(\w+)-' + run_cpu, lib) + match = re.match(r'(?:lib)?clang_rt\.(\w+)-' + run_cpu + env, lib) if match: libs[match[1]] = lib diff --git a/test/stdlib/FloatingPointIR_FP80.swift b/test/stdlib/FloatingPointIR_FP80.swift index a5f0344ec054e..318d7010b5159 100644 --- a/test/stdlib/FloatingPointIR_FP80.swift +++ b/test/stdlib/FloatingPointIR_FP80.swift @@ -3,7 +3,9 @@ // RUN: %target-build-swift -Ounchecked -emit-ir %s | %FileCheck -check-prefix=%target-cpu %s // REQUIRES: CPU=i386 || CPU=x86_64 -// UNSUPPORTED: OS=windows-msvc +// +// Windows and Android do not expose Float80. +// UNSUPPORTED: OS=windows-msvc, OS=linux-android var globalFloat80 : Float80 = 0.0 From 5554fd271a628546d39d7adca6d4881063c62515 Mon Sep 17 00:00:00 2001 From: finagolfin Date: Wed, 21 May 2025 03:05:05 +0530 Subject: [PATCH 2/7] [test] Fix IRGen/framepointer.sil for the test-simulator CI (#81643) which generates IR without a llvm.trap function All the normal CI generated this: ``` ret i32 %1 } ; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write) declare void @llvm.trap() #1 attributes #0 = { "frame-pointer"= ``` But the test-simulator CI doesn't for some reason, so just check for the closing brace instead. --- test/IRGen/framepointer.sil | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/IRGen/framepointer.sil b/test/IRGen/framepointer.sil index 14054a9e7bd49..39202c14fa5b7 100644 --- a/test/IRGen/framepointer.sil +++ b/test/IRGen/framepointer.sil @@ -31,12 +31,12 @@ entry(%i : $Int32): // CHECK: entry: // CHECK: %1 = call swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) // CHECK: ret i32 %1 -// CHECK: } -// CHECK-SYSV: Function Attrs: +// CHECK-SYSV: } // CHECK-SYSV-macosx: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all" // CHECK-SYSV-linux-gnu: attributes [[ATTR]] = { {{.*}}"frame-pointer"="all" // CHECK-SYSV-linux-android: attributes [[ATTR]] = { {{.*}}"frame-pointer"="non-leaf" +// CHECK-WIN: } // CHECK-WIN: attributes [[ATTR]] = { {{.*}} // CHECK-ALL: define{{.*}} swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) [[ATTR:#.*]] { From 046821c5d527b8802b462cafd7baf5e26e3022ff Mon Sep 17 00:00:00 2001 From: finagolfin Date: Thu, 22 May 2025 10:01:24 +0530 Subject: [PATCH 3/7] Merge pull request #81695 from finagolfin/lto [test] Fix IRGen/lto_autolink on Darwin arm64 platforms too --- test/IRGen/lto_autolink.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/IRGen/lto_autolink.swift b/test/IRGen/lto_autolink.swift index ccf196e5bf167..54ba4a98442c0 100644 --- a/test/IRGen/lto_autolink.swift +++ b/test/IRGen/lto_autolink.swift @@ -19,8 +19,8 @@ import empty // RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.15 -emit-module -parse-stdlib -o %t -module-name empty -module-link-name empty %S/../Inputs/empty.swift -// RUN: %target-swift-emit-ir -target %target-cpu-apple-macosx10.15 -lto=llvm-full -parse-stdlib -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-MACHO-MERGE -// RUN: %target-swift-emit-ir -target %target-cpu-apple-macosx10.15 -lto=llvm-thin -parse-stdlib -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-MACHO-MERGE +// RUN: %target-swift-emit-ir -target %target-cpu-apple-macosx10.15 -lto=llvm-full -parse-stdlib -nostdimport -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-MACHO-MERGE +// RUN: %target-swift-emit-ir -target %target-cpu-apple-macosx10.15 -lto=llvm-thin -parse-stdlib -nostdimport -I %t -I %S/Inputs -DTEST_CLANG_OPTIONS_MERGE %s | %FileCheck %s --check-prefix CHECK-MACHO-MERGE // CHECK-MACHO-MERGE-DAG: !llvm.linker.options = !{ // CHECK-MACHO-MERGE-DAG: !{{[0-9]+}} = !{!"-lempty"} From 8a286e0738b6c5b767a8fda0de0c5c5783479ef8 Mon Sep 17 00:00:00 2001 From: Ryan Mansfield Date: Thu, 29 May 2025 14:22:44 -0400 Subject: [PATCH 4/7] Re-add UNSUPPORTED for watchos arm64_32 in lto_autolink.swift. Tests are failing with: :0: error: unknown target triple 'arm64_32-unknown-linux-gnu' :0: error: clang importer creation failed --- test/IRGen/lto_autolink.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/IRGen/lto_autolink.swift b/test/IRGen/lto_autolink.swift index 54ba4a98442c0..6711bf4e3a8b4 100644 --- a/test/IRGen/lto_autolink.swift +++ b/test/IRGen/lto_autolink.swift @@ -43,4 +43,5 @@ import AutolinkElfCPragma import AutolinkModuleMapLink #endif +// UNSUPPORTED: OS=watchos && (CPU=arm64_32 || CPU=armv7k) // UNSUPPORTED: CPU=wasm32 From 9f6a172458024fef7de480713ec5d6573f234251 Mon Sep 17 00:00:00 2001 From: finagolfin Date: Tue, 6 May 2025 13:54:26 +0530 Subject: [PATCH 5/7] [test] Fix checking C and C++ headers for cross-compilation by explicitly adding the sysroot and target triple (#81312) @weliveindetail noticed that these header checks when cross-compiling are incorrectly checked against the host C and C++ headers and target, so he added the cross-compilation sysroot for the C++ header check alone more than a month ago in #79185. However, that broke several C++ Interop tests when running the compiler validation suite for Android on both [the Windows toolchain CI](https://ci-external.swift.org/job/swift-main-windows-toolchain/) and [the community Android CI on a linux host](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/): ``` FAIL: Swift(android-x86_64) :: Interop/SwiftToCxx/class/nested-classes-in-cxx.swift (4495 of 18856) ******************** TEST 'Swift(android-x86_64) :: Interop/SwiftToCxx/class/nested-classes-in-cxx.swift' FAILED ******************** Exit Code: 1 Command Output (stdout): -- # RUN: at line 1 rm -rf "T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp" && mkdir -p "T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp" # executed command: rm -rf 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp' # executed command: mkdir -p 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp' # RUN: at line 2 t:\5\bin\swift-frontend.exe -target x86_64-unknown-linux-android -sdk T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -resource-dir T:/x86_64-unknown-linux-android28/Runtime/./lib/swift -module-cache-path T:\x86_64-unknown-linux-android28\Runtime\swift-test-results\x86_64-unknown-linux-android\clang-module-cache -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.1' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -typo-correction-limit 10 C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift\test\Interop\SwiftToCxx\class\nested-classes-in-cxx.swift -enable-library-evolution -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h # executed command: 't:\5\bin\swift-frontend.exe' -target x86_64-unknown-linux-android -sdk T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -resource-dir T:/x86_64-unknown-linux-android28/Runtime/./lib/swift -module-cache-path 'T:\x86_64-unknown-linux-android28\Runtime\swift-test-results\x86_64-unknown-linux-android\clang-module-cache' -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.1' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -typo-correction-limit 10 'C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift\test\Interop\SwiftToCxx\class\nested-classes-in-cxx.swift' -enable-library-evolution -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h' # RUN: at line 3 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 && 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++17 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 && 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 # executed command: 't:\\5\\bin\\clang++.exe' '-fmodules-cache-path=T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk/frameworks' -I 'T:\x86_64-unknown-linux-android28\LLVM\include' -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test/Inputs/clang-importer-sdk' -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h' -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 # .---command stderr------------ # | T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h:29:10: fatal error: 'cstdint' file not found # | 29 | #include # | | ^~~~~~~~~ # | 1 error generated. # `----------------------------- # error: command failed with exit status: 1 ``` I experimented a bit and found that explicitly passing in the target triple fixed these tests, so this pull does that for C++ and also corrects the C header check. --- test/lit.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lit.cfg b/test/lit.cfg index 4250ee522f12f..89972960cf16f 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2747,6 +2747,8 @@ extraCheckWarningFlags = ( # Verifies that a C++ file can be compiled without warnings except for some exceptions. config.substitutions.insert(0, ('%check-c-header-in-clang', '%clang -fsyntax-only -x c-header ' + extraCheckWarningFlags + + ' --sysroot %r ' % config.variant_sdk + + '-target %r ' % config.variant_triple + # Use standard header/framework search paths. '-F %%clang-importer-sdk-path/frameworks ' '-I %%clang-include-dir ' @@ -2756,6 +2758,7 @@ config.substitutions.insert(0, ('%check-c-header-in-clang', config.substitutions.insert(0, ('%check-cxx-header-in-clang', '%clangxx -fsyntax-only -x c++-header ' + extraCheckWarningFlags + ' --sysroot %r ' % config.variant_sdk + + '-target %r ' % config.variant_triple + # Use standard header/framework search paths. '-F %%clang-importer-sdk-path/frameworks ' '-I %%clang-include-dir %%cxx-stdlib-include ' From 2e5e72baa282ccbe361e7e6d780b2bd928ac687a Mon Sep 17 00:00:00 2001 From: finagolfin Date: Tue, 3 Jun 2025 14:57:29 +0530 Subject: [PATCH 6/7] [build] Add a new `--cross-compile-build-swift-tools` flag to disable cross-compiling the compiler (#38441) This is useful when building cross-compilation toolchains where you want the stdlib and corelibs cross-compiled but don't want the Swift compiler cross-compiled too with `--cross-compile-hosts`. --- utils/build-script-impl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/build-script-impl b/utils/build-script-impl index b19e6a3fdbf09..cfbf761ca6274 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -292,6 +292,7 @@ KNOWN_SETTINGS=( cross-compile-install-prefixes "" "semicolon-separated list of install prefixes to use for the cross-compiled hosts. The list expands, so if there are more cross-compile hosts than prefixes, unmatched hosts use the last prefix in the list" cross-compile-deps-path "" "path for CMake to look for cross-compiled library dependencies, such as libXML2" cross-compile-append-host-target-to-destdir "1" "turns on appending the host target name of each cross-compiled toolchain to its install-destdir, to keep them separate from the natively-built toolchain" + cross-compile-build-swift-tools "1" "set to 1 to cross-compile the Swift host tools, like the Swift compiler" skip-merge-lipo-cross-compile-tools "" "set to skip running merge-lipo after installing cross-compiled host Swift tools" coverage-db "" "If set, coverage database to use when prioritizing testing" skip-local-host-install "" "If we are cross-compiling multiple targets, skip an install pass locally if the hosts match" @@ -1707,6 +1708,12 @@ for host in "${ALL_HOSTS[@]}"; do "${cmake_options[@]}" -DLLVM_TABLEGEN=$(build_directory "${LOCAL_HOST}" llvm)/bin/llvm-tblgen -DSWIFT_INCLUDE_TEST_BINARIES:BOOL=FALSE + -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}") + ) + else + cmake_options=( + "${cmake_options[@]}" + -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}") ) fi @@ -1779,7 +1786,6 @@ for host in "${ALL_HOSTS[@]}"; do -DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}" -DSWIFT_NATIVE_CLANG_TOOLS_PATH:STRING="${native_clang_tools_path}" -DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING="${native_swift_tools_path}" - -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}") -DSWIFT_BUILD_CLANG_OVERLAYS:BOOL=$(true_false "${BUILD_SWIFT_CLANG_OVERLAYS}") -DSWIFT_BUILD_REMOTE_MIRROR:BOOL=$(true_false "${BUILD_SWIFT_REMOTE_MIRROR}") -DSWIFT_STDLIB_SIL_DEBUGGING:BOOL=$(true_false "${BUILD_SIL_DEBUGGING_STDLIB}") From 6065c13a2374a9ceb49641ba228af56059d66f23 Mon Sep 17 00:00:00 2001 From: finagolfin Date: Wed, 11 Jun 2025 21:43:56 +0530 Subject: [PATCH 7/7] [build] Switch over to new `--cross-compile-build-swift-tools` flag when cross-compiling Foundation macros (#82163) Follow-on to #38441, missed this there. --- utils/build-script-impl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/build-script-impl b/utils/build-script-impl index cfbf761ca6274..6e538161f83c4 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -2336,7 +2336,7 @@ for host in "${ALL_HOSTS[@]}"; do continue fi - if [[ "${BUILD_SWIFT_TOOLS}" == "0" ]]; then + if [[ "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}" == "0" ]]; then echo "Skipping building Foundation Macros for ${host}, because the host tools are not being built" continue fi @@ -2925,7 +2925,7 @@ for host in "${ALL_HOSTS[@]}"; do continue fi - if [[ "${BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then + if [[ "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then echo "Skipping installing Foundation Macros for ${host}, because the host tools are not being built" continue fi