| 1 |
// Test which driver flags enable/disable Function Multiversioning on aarch64. |
| 2 |
|
| 3 |
// FMV is enabled for non-android aarch64 targets: |
| 4 |
// RUN: %clang --target=aarch64 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 5 |
// RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 6 |
// RUN: %clang --target=arm64-apple-ios --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 7 |
// RUN: %clang --target=arm64-apple-macosx --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 8 |
|
| 9 |
// android23 defaults to --rtlib=compiler-rt: |
| 10 |
// RUN: %clang --target=aarch64-linux-android23 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 11 |
// RUN: %clang --target=aarch64-linux-android23 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s |
| 12 |
|
| 13 |
// FMV is disabled without compiler-rt: |
| 14 |
// RUN: %clang --rtlib=libgcc --target=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 15 |
// RUN: %clang --rtlib=libgcc --target=aarch64-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 16 |
|
| 17 |
// Disabled for older android versions: |
| 18 |
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 19 |
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 20 |
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 21 |
|
| 22 |
// Disabled explicitly: |
| 23 |
// RUN: %clang --rtlib=compiler-rt --target=aarch64 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 24 |
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android23 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s |
| 25 |
|
| 26 |
// FMV-ENABLED-NOT: "-target-feature" "-fmv" |
| 27 |
// FMV-DISABLED: "-target-feature" "-fmv" |