Skip to content

Commit d5b48bc

Browse files
committed
[Apple Silicon] Generalize tests for other macOS architectures
Most of the changes fall into a few categories: * Replace explicit "x86_64" with %target-cpu in lit tests * Cope with architecture differences in IR/asm/etc. macOS-specific tests
1 parent d795169 commit d5b48bc

30 files changed

+103
-105
lines changed

test/ClangImporter/availability_implicit_macosx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -typecheck -verify -target x86_64-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift
2-
// RUN: not %swift -typecheck -target x86_64-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift 2>&1 | %FileCheck %s '--implicit-check-not=<unknown>:0'
1+
// RUN: %swift -typecheck -verify -target %target-cpu-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift
2+
// RUN: not %swift -typecheck -target %target-cpu-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift 2>&1 | %FileCheck %s '--implicit-check-not=<unknown>:0'
33

44
// REQUIRES: OS=macosx
55

test/ClangImporter/bad-deployment-target.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) -typecheck -target x86_64-apple-macosx10.8 %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -target %target-cpu-apple-macosx10.8 %s
22
//
33
// This test ensures that a -target that is too old for the standard library
44
// will not crash in the ClangImporter.

test/ClangImporter/enum-with-target.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.51 -typecheck %s -verify
2-
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.52 -typecheck %s -verify
1+
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx10.51 -typecheck %s -verify
2+
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx10.52 -typecheck %s -verify
33

44
// REQUIRES: OS=macosx
55
import Foundation

test/ClangImporter/objc_factory_method.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-clang-importer-objc-overlays
33

4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target x86_64-apple-macosx10.51 -typecheck %s -verify
4+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target %target-cpu-apple-macosx10.51 -typecheck %s -verify
55

66
// REQUIRES: OS=macosx
77
// REQUIRES: objc_interop

test/ClangImporter/objc_ir.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func instanceMethods(_ b: B) {
3434
func extensionMethods(b b: B) {
3535
// CHECK: load i8*, i8** @"\01L_selector(method:separateExtMethod:)", align 8
3636
// CHECK: [[T0:%.*]] = call i8* bitcast (void ()* @objc_msgSend to i8*
37-
// CHECK-NEXT: [[T1:%.*]] = {{.*}}call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
37+
// CHECK: [[T1:%.*]] = {{.*}}call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
3838
// CHECK-NOT: [[T0]]
3939
// CHECK: [[T1]]
4040
b.method(1, separateExtMethod:1.5)

test/Driver/print_target_info_macos.swift

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

88
// REQUIRES: OS=macosx
99

10-
// CHECK: "triple": "x86_64-apple-macosx10
11-
// CHECK: "unversionedTriple": "x86_64-apple-macosx"
10+
// CHECK: "triple": "{{.*}}-apple-macosx10
11+
// CHECK: "unversionedTriple": "{{.*}}-apple-macosx"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: not %swift-ide-test -source-filename %s -print-module -module-to-print Swift -target x86_64-unknown-solaris
22

33
// RUN: %empty-directory(%t)
4-
// RUN: %target-swift-frontend -emit-module -o %t -module-name Dummy -target x86_64-apple-macosx10.99 %s
4+
// RUN: %target-swift-frontend -emit-module -o %t -module-name Dummy -target %target-cpu-apple-macosx10.99 %s
55
// RUN: not %target-swift-ide-test -source-filename %s -print-module -module-to-print Dummy -I %t
66

77
// REQUIRES: OS=macosx

test/IRGen/autolink-runtime-compatibility.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// REQUIRES: OS=macosx
22

33
// Doesn't autolink compatibility library because autolinking is disabled
4-
// RUN: %target-swift-frontend -disable-autolinking-runtime-compatibility-dynamic-replacements -target x86_64-apple-macosx10.9 -disable-autolinking-runtime-compatibility -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
4+
// RUN: %target-swift-frontend -disable-autolinking-runtime-compatibility-dynamic-replacements -target %target-cpu-apple-macosx10.9 -disable-autolinking-runtime-compatibility -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
55
// RUN: %target-swift-frontend -disable-autolinking-runtime-compatibility-dynamic-replacements -runtime-compatibility-version 5.0 -disable-autolinking-runtime-compatibility -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
66

77
// Doesn't autolink compatibility library because runtime compatibility library is disabled
88
// RUN: %target-swift-frontend -runtime-compatibility-version none -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
99

1010
// Doesn't autolink compatibility library because target OS doesn't need it
11-
// RUN: %target-swift-frontend -target x86_64-apple-macosx10.24 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
11+
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.24 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
1212

1313
// Only autolinks 5.1 compatibility library because target OS has 5.1
14-
// RUN: %target-swift-frontend -target x86_64-apple-macosx10.15 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
14+
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.15 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
1515

1616
// Autolinks because compatibility library was explicitly asked for
1717
// RUN: %target-swift-frontend -runtime-compatibility-version 5.0 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD %s
1818
// RUN: %target-swift-frontend -runtime-compatibility-version 5.1 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
19-
// RUN: %target-swift-frontend -target x86_64-apple-macosx10.24 -runtime-compatibility-version 5.0 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD %s
20-
// RUN: %target-swift-frontend -target x86_64-apple-macosx10.24 -runtime-compatibility-version 5.1 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
19+
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.24 -runtime-compatibility-version 5.0 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD %s
20+
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.24 -runtime-compatibility-version 5.1 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
2121

2222
public func foo() {}
2323

test/IRGen/condfail.sil

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import Swift
1717
// CHECK-powerpc64: .cfi_startproc
1818
// CHECK-powerpc64le: .cfi_startproc
1919
// CHECK-s390x: .cfi_startproc
20-
// CHECK-OPT-macosx: ## InlineAsm Start
21-
// CHECK-OPT-macosx: ## InlineAsm End
20+
// CHECK-OPT-macosx: InlineAsm Start
21+
// CHECK-OPT-macosx: InlineAsm End
2222
// CHECK-OPT-linux: ##APP
2323
// CHECK-OPT-linux: ##NO_APP
2424
// CHECK-OPT-windows: ##APP
@@ -27,8 +27,8 @@ import Swift
2727
// CHECK-OPT-linux-androideabi: @NO_APP
2828
// CHECK-OPT-linux-android: //APP
2929
// CHECK-OPT-linux-android: //NO_APP
30-
// CHECK-NOOPT-macosx-NOT: ## InlineAsm Start
31-
// CHECK-NOOPT-macosx-NOT: ## InlineAsm End
30+
// CHECK-NOOPT-macosx-NOT: InlineAsm Start
31+
// CHECK-NOOPT-macosx-NOT: InlineAsm End
3232
// CHECK-NOOPT-linux-NOT: ##APP
3333
// CHECK-NOOPT-linux-NOT: ##NO_APP
3434
// CHECK-NOOPT-windows-NOT: ##APP
@@ -55,14 +55,14 @@ import Swift
5555
// CHECK-NOT-powerpc64: .cfi_endproc
5656
// CHECK-NOT-powerpc64le: .cfi_endproc
5757
// CHECK-NOT-s390x: .cfi_endproc
58-
// CHECK-OPT-macosx: ## InlineAsm Start
59-
// CHECK-OPT-macosx: ## InlineAsm End
58+
// CHECK-OPT-macosx: InlineAsm Start
59+
// CHECK-OPT-macosx: InlineAsm End
6060
// CHECK-OPT-linux: ##APP
6161
// CHECK-OPT-linux: ##NO_APP
6262
// CHECK-OPT-windows: ##APP
6363
// CHECK-OPT-windows: ##NO_APP
64-
// CHECK-NOOPT-macosx-NOT: ## InlineAsm Start
65-
// CHECK-NOOPT-macosx-NOT: ## InlineAsm End
64+
// CHECK-NOOPT-macosx-NOT: InlineAsm Start
65+
// CHECK-NOOPT-macosx-NOT: InlineAsm End
6666
// CHECK-NOOPT-linux-NOT: ##APP
6767
// CHECK-NOOPT-linux-NOT: ##NO_APP
6868
// CHECK-NOOPT-windows-NOT: ##APP

test/IRGen/lazy_metadata_with-g.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swiftc_driver -parse-as-library -module-name=test -target x86_64-apple-macosx10.15 -wmo -O -g -emit-ir %s | %FileCheck %s
1+
// RUN: %target-swiftc_driver -parse-as-library -module-name=test -target %target-cpu-apple-macosx10.15 -wmo -O -g -emit-ir %s | %FileCheck %s
22
// REQUIRES: OS=macosx
33

44
// Check that the compiler does not emit any metadata for unused internal

0 commit comments

Comments
 (0)