Skip to content

[Driver] Mark -arch as TargetSpecific #74365

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 1 commit into from
Dec 5, 2023
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
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ def all__load : Flag<["-"], "all_load">;
def allowable__client : Separate<["-"], "allowable_client">;
def ansi : Flag<["-", "--"], "ansi">, Group<CompileOnly_Group>;
def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">;
def arch : Separate<["-"], "arch">, Flags<[NoXarchOption]>;
def arch : Separate<["-"], "arch">, Flags<[NoXarchOption,TargetSpecific]>;
def arch__only : Separate<["-"], "arch_only">;
def autocomplete : Joined<["--"], "autocomplete=">;
def bind__at__load : Flag<["-"], "bind_at_load">;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/arc-exceptions.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang -### -x objective-c -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log
// RUN: %clang -### -x objective-c --target=x86_64-apple-macos10.6 -fobjc-arc -fsyntax-only %s 2> %t.log
// RUN: grep objective-c %t.log
// RUN: not grep "fobjc-arc-exceptions" %t.log
// RUN: %clang -### -x objective-c++ -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log
// RUN: %clang -### -x objective-c++ --target=x86_64-apple-macos10.6 -fobjc-arc -fsyntax-only %s 2> %t.log
// RUN: grep "fobjc-arc-exceptions" %t.log
5 changes: 3 additions & 2 deletions clang/test/Driver/arm-arch-darwin.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// On Darwin, arch should override CPU for triple purposes
// RUN: %clang -target armv7m-apple-darwin -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7M-DARWIN %s
// CHECK-V7M-DARWIN: "-cc1"{{.*}} "-triple" "thumbv7m-{{.*}} "-target-cpu" "cortex-m4"
// RUN: %clang -target armv7m -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7M-OVERRIDDEN %s
// CHECK-V7M-OVERRIDDEN: "-cc1"{{.*}} "-triple" "thumbv7em-{{.*}} "-target-cpu" "cortex-m4"

/// -arch is unsupported for non-Darwin targets.
// RUN: not %clang --target=armv7m -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ERR %s
// ERR: unsupported option '-arch' for target 'armv7m'
6 changes: 3 additions & 3 deletions clang/test/Frontend/darwin-eabi.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang -arch armv6m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7em -dM -E %s | FileCheck %s
// RUN: %clang --target=armv6m-apple-darwin -dM -E %s | FileCheck %s
// RUN: %clang --target=armv7m-apple-darwin -dM -E %s | FileCheck %s
// RUN: %clang --target=armv7em-apple-darwin -dM -E %s | FileCheck %s
// RUN: %clang_cc1 -triple thumbv7m-apple-unknown-macho -dM -E %s | FileCheck %s

// CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
Expand Down