mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ClangImporter: handle -target-cpu for x86 targets
`-mcpu` is a deprecated "alias" (unsupported) on x86 targets for `-mtune`. Unlike `-mcpu`, `-mtune` simply tunes the code for the CPU but does not prevent execution on other targets. In order to match the behaviour of `-mcpu` on ARM, we must use both `-march=` and `-mtune=`. Adjust this behaviour to allow tuning of code for non-Darwin targets.
This commit is contained in:
@@ -40,3 +40,6 @@
|
||||
// RUN: not %swift -typecheck -target s390x-unknown-linux-gnu -Xcc -### %s 2>&1 | %FileCheck -check-prefix=S390X_CPU %s
|
||||
// S390X_CPU: "-target-cpu" "z13"
|
||||
|
||||
// RUN: not %swiftc -typecheck -target x86_64-unknown-windows-msvc -target-cpu haswell -Xcc -### %s 2>&1 | %FileCheck -check-prefix X86_64 %s
|
||||
// X86_64: "-target-cpu" "haswell"
|
||||
// X86_64: "-tune-cpu" "haswell"
|
||||
|
||||
Reference in New Issue
Block a user