1 // Test that target feature FEAT_RCPC3 is implemented and available correctly
3 // FEAT_RCPC3 is optional for v8.2a onwards, and can be enabled with +rcpc3
4 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.9-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
5 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.9-a+rcpc3 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
6 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.9-a+norcpc3 %s 2>&1 | FileCheck %s --check-prefix=DISABLED
7 // RUN: %clang -### --target=aarch64-none-elf -march=armv9.4-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
8 // RUN: %clang -### --target=aarch64-none-elf -march=armv9.4-a+rcpc3 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
9 // RUN: %clang -### --target=aarch64-none-elf -march=armv9.4-a+norcpc3 %s 2>&1 | FileCheck %s --check-prefix=DISABLED
11 // FEAT_RCPC3 is optional (off by default) for v8.8a/9.3a and older, and can be enabled using +rcpc3
12 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.2-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
13 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.2-a+rcpc3 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
14 // RUN: %clang -### --target=aarch64-none-elf -march=armv8.2-a+norcpc3 %s 2>&1 | FileCheck %s --check-prefix=DISABLED
15 // RUN: %clang -### --target=aarch64-none-elf -march=armv9-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
16 // RUN: %clang -### --target=aarch64-none-elf -march=armv9-a+rcpc3 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
17 // RUN: %clang -### --target=aarch64-none-elf -march=armv9-a+norcpc3 %s 2>&1 | FileCheck %s --check-prefix=DISABLED
19 // FEAT_RCPC3 is invalid before v8
20 // RUN: not %clang -### --target=arm-none-none-eabi -march=armv7-a+rcpc3 %s 2>&1 | FileCheck %s --check-prefix=INVALID
22 // INVALID: error: unsupported argument 'armv7-a+rcpc3' to option '-march='
23 // ENABLED: "-target-feature" "+rcpc3"
24 // NOT_ENABLED-NOT: "-target-feature" "+rcpc3"
25 // DISABLED: "-target-feature" "-rcpc3"