Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][Driver] Warn on invalid Arm or AArch64 baremetal target triple
A common user mistake is specifying a target of aarch64-none-eabi or arm-none-elf whereas the correct names are aarch64-none-elf & arm-none-eabi. Currently if a target of aarch64-none-eabi is specified then the Generic_ELF toolchain is used, unlike aarch64-none-elf which will use the BareMetal toolchain. This is unlikely to be intended by the user so issue a warning that the target is invalid. The target parser is liberal in what input it accepts so invalid triples may yield behaviour that's sufficiently close to what the user intended. Therefore invalid triples were used in many tests. This change updates those tests to use valid triples. One test (gnu-mcount.c) relies on the Generic_ELF toolchain behaviour so change it to explicitly specify aarch64-unknown-none-gnu as the target. Reviewed By: peter.smith, DavidSpickett Differential Revision: https://reviews.llvm.org/D153430
- Loading branch information
Showing
40 changed files
with
304 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// Test that target feature hbc is implemented and available correctly | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv8.7-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv8.8-a %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv8.8-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv8.8-a+nohbc %s 2>&1 | FileCheck %s --check-prefix=NO_HBC | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv9.2-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv9.3-a %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv9.3-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-none-eabi -march=armv9.3-a+nohbc %s 2>&1 | FileCheck %s --check-prefix=NO_HBC | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv8.7-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv8.8-a %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv8.8-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv8.8-a+nohbc %s 2>&1 | FileCheck %s --check-prefix=NO_HBC | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv9.2-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv9.3-a %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv9.3-a+hbc %s 2>&1 | FileCheck %s | ||
// RUN: %clang -S -o - -emit-llvm --target=aarch64-none-elf -march=armv9.3-a+nohbc %s 2>&1 | FileCheck %s --check-prefix=NO_HBC | ||
|
||
// CHECK: "target-features"="{{.*}},+hbc | ||
// NO_HBC: "target-features"="{{.*}},-hbc | ||
|
||
void test() {} | ||
void test() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// Test that target feature ls64 is implemented and available correctly | ||
|
||
// RUN: %clang -### --target=aarch64-none-none-eabi -march=armv8.7-a+ls64 %s 2>&1 | FileCheck %s | ||
// RUN: %clang -### --target=aarch64-none-elf -march=armv8.7-a+ls64 %s 2>&1 | FileCheck %s | ||
// CHECK: "-target-feature" "+ls64" | ||
|
||
// RUN: %clang -### --target=aarch64-none-none-eabi -march=armv8.7-a+nols64 %s 2>&1 | FileCheck %s --check-prefix=NO_LS64 | ||
// RUN: %clang -### --target=aarch64-none-elf -march=armv8.7-a+nols64 %s 2>&1 | FileCheck %s --check-prefix=NO_LS64 | ||
// NO_LS64: "-target-feature" "-ls64" | ||
|
||
// The LD64B/ST64B accelerator extension is disabled by default. | ||
// RUN: %clang -### --target=aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// RUN: %clang -### --target=aarch64-none-none-eabi -march=armv8.7-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// RUN: %clang -### --target=aarch64-none-none-eabi -march=armv8.7-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// RUN: %clang -### --target=aarch64-none-elf %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// RUN: %clang -### --target=aarch64-none-elf -march=armv8.7-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// RUN: %clang -### --target=aarch64-none-elf -march=armv8.7-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_LS64 | ||
// ABSENT_LS64-NOT: "-target-feature" "+ls64" | ||
// ABSENT_LS64-NOT: "-target-feature" "-ls64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.