Skip to content

[Driver] Rearrange some Apple version testing #94514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions clang/test/Driver/apple-os-triples.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Test triple manipulations.

// RUN: %clang -### -c %s \
// RUN: --target=i386-apple-darwin10 -mappletvsimulator-version-min=9.0 -arch x86_64 2>&1 | \
// RUN: FileCheck %s -DARCH=x86_64 -DOS=tvos9.0.0-simulator
// RUN: %clang -### -c %s \
// RUN: --target=armv7s-apple-darwin10 -mappletvos-version-min=9.0 -arch arm64 2>&1 | \
// RUN: FileCheck %s -DARCH=arm64 -DOS=tvos9.0.0
// RUN: env TVOS_DEPLOYMENT_TARGET=9.0 %clang -### -c %s \
// RUN: -isysroot SDKs/MacOSX10.9.sdk -target i386-apple-darwin10 -arch x86_64 2>&1 | \
// RUN: FileCheck %s -DARCH=x86_64 -DOS=tvos9.0.0

// RUN: %clang -### -c %s \
// RUN: --target=x86_64-apple-driverkit19.0 2>&1 | \
// RUN: FileCheck %s -DARCH=x86_64 -DOS=driverkit19.0.0

// RUN: %clang -### -c %s \
// RUN: --target=i386-apple-darwin10 -miphonesimulator-version-min=7.0 -arch i386 2>&1 | \
// RUN: FileCheck %s -DARCH=i386 -DOS=ios7.0.0-simulator
// RUN: %clang -### -c %s \
// RUN: --target=armv7s-apple-darwin10 -miphoneos-version-min=7.0 -arch armv7s 2>&1 | \
// RUN: FileCheck %s -DARCH=thumbv7s -DOS=ios7.0.0

// RUN: %clang -### -c %s \
// RUN: --target=i386-apple-darwin10 -mwatchsimulator-version-min=2.0 -arch i386 2>&1 | \
// RUN: FileCheck %s -DARCH=i386 -DOS=watchos2.0.0-simulator
// RUN: %clang -### -c %s \
// RUN: --target=armv7s-apple-darwin10 -mwatchos-version-min=2.0 -arch armv7k 2>&1 | \
// RUN: FileCheck %s -DARCH=thumbv7k -DOS=watchos2.0.0

// CHECK: "-cc1" "-triple" "[[ARCH]]-apple-[[OS]]"
8 changes: 0 additions & 8 deletions clang/test/Driver/appletvos-version-min.c

This file was deleted.

5 changes: 0 additions & 5 deletions clang/test/Driver/driverkit-version-min.c

This file was deleted.

7 changes: 0 additions & 7 deletions clang/test/Driver/ios-version-min.c

This file was deleted.

7 changes: 0 additions & 7 deletions clang/test/Driver/watchos-version-min.c

This file was deleted.

9 changes: 9 additions & 0 deletions llvm/test/CodeGen/ARM/apple-version-min.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; Test emitting version_min directives.

; RUN: llc %s -filetype=asm -o - --mtriple arm64-apple-tvos9.0.0 | FileCheck %s --check-prefix=TVOS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right directory for AArch64 tests (which apple calls arm64 in its triples), these tests will only be run if the ARM backend is enabled, whereas I think this line only wants to be run if the AArch64 backend is enabled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this test has one arm64 command and two thumb commands.

I just now pushed #95106 to add aarch64-registered-target to this test. I did that because the different options are thematically related and splitting into two tests seemed not in the best interests of test coherency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fix makes sense to me. Thanks!

; RUN: llc %s -filetype=asm -o - --mtriple thumbv7s-apple-ios7.0.0 | FileCheck %s --check-prefix=IOS
; RUN: llc %s -filetype=asm -o - --mtriple thumbv7k-apple-watchos2.0.0 | FileCheck %s --check-prefix=WATCHOS

; TVOS: .tvos_version_min 9, 0
; IOS: .ios_version_min 7, 0
; WATCHOS: .watchos_version_min 2, 0
12 changes: 12 additions & 0 deletions llvm/test/CodeGen/X86/apple-version-min.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; Test emitting version_min directives.

; RUN: llc %s -filetype=asm -o - --mtriple x86_64-apple-tvos9.0.0-simulator | FileCheck %s --check-prefix=TVOS
; RUN: llc %s -filetype=asm -o - --mtriple x86_64-apple-tvos9.0.0 | FileCheck %s --check-prefix=TVOS
; RUN: llc %s -filetype=asm -o - --mtriple x86_64-apple-driverkit19.0.0 | FileCheck %s --check-prefix=DRIVERKIT
; RUN: llc %s -filetype=asm -o - --mtriple i386-apple-ios7.0.0-simulator | FileCheck %s --check-prefix=IOS
; RUN: llc %s -filetype=asm -o - --mtriple i386-apple-watchos2.0.0-simulator | FileCheck %s --check-prefix=WATCHOS

; TVOS: .tvos_version_min 9, 0
; DRIVERKIT: .build_version driverkit, 19, 0
; IOS: .ios_version_min 7, 0
; WATCHOS: .watchos_version_min 2, 0
Loading