| 1 |
! Test that -mcpu/march are used and that the -target-cpu and -target-features |
| 2 |
! are also added to the fc1 command. |
| 3 |
|
| 4 |
! RUN: %flang --target=aarch64-linux-gnu -mcpu=cortex-a57 -c %s -### 2>&1 \ |
| 5 |
! RUN: | FileCheck %s -check-prefix=CHECK-A57 |
| 6 |
|
| 7 |
! RUN: %flang --target=aarch64-linux-gnu -mcpu=cortex-a76 -c %s -### 2>&1 \ |
| 8 |
! RUN: | FileCheck %s -check-prefix=CHECK-A76 |
| 9 |
|
| 10 |
! RUN: %flang --target=aarch64-linux-gnu -march=armv9 -c %s -### 2>&1 \ |
| 11 |
! RUN: | FileCheck %s -check-prefix=CHECK-ARMV9 |
| 12 |
|
| 13 |
! Negative test. ARM cpu with x86 target. |
| 14 |
! RUN: not %flang --target=x86_64-linux-gnu -mcpu=cortex-a57 -c %s -### 2>&1 \ |
| 15 |
! RUN: | FileCheck %s -check-prefix=CHECK-NO-A57 |
| 16 |
|
| 17 |
! RUN: %flang --target=x86_64-linux-gnu -march=skylake -c %s -### 2>&1 \ |
| 18 |
! RUN: | FileCheck %s -check-prefix=CHECK-SKYLAKE |
| 19 |
|
| 20 |
! RUN: %flang --target=x86_64-linux-gnu -mapx-features=egpr -c %s -### 2>&1 \ |
| 21 |
! RUN: | FileCheck %s -check-prefix=CHECK-APX |
| 22 |
|
| 23 |
! RUN: %flang --target=x86_64-linux-gnu -mno-apx-features=ccmp -c %s -### 2>&1 \ |
| 24 |
! RUN: | FileCheck %s -check-prefix=CHECK-NO-APX |
| 25 |
|
| 26 |
! RUN: %flang --target=x86_64h-linux-gnu -c %s -### 2>&1 \ |
| 27 |
! RUN: | FileCheck %s -check-prefix=CHECK-X86_64H |
| 28 |
|
| 29 |
! RUN: %flang --target=riscv64-linux-gnu -c %s -### 2>&1 \ |
| 30 |
! RUN: | FileCheck %s -check-prefix=CHECK-RV64 |
| 31 |
|
| 32 |
! RUN: %flang --target=amdgcn-amd-amdhsa -mcpu=gfx908 -c %s -### 2>&1 \ |
| 33 |
! RUN: | FileCheck %s -check-prefix=CHECK-AMDGPU |
| 34 |
|
| 35 |
! RUN: %flang --target=r600-unknown-unknown -mcpu=cayman -c %s -### 2>&1 \ |
| 36 |
! RUN: | FileCheck %s -check-prefix=CHECK-AMDGPU-R600 |
| 37 |
|
| 38 |
! CHECK-A57: "-fc1" "-triple" "aarch64-unknown-linux-gnu" |
| 39 |
! CHECK-A57-SAME: "-target-cpu" "cortex-a57" |
| 40 |
! CHECK-A57-SAME: "-target-feature" "+v8a" "-target-feature" "+aes" "-target-feature" "+crc" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+perfmon" "-target-feature" "+sha2 |
| 41 |
|
| 42 |
! CHECK-A76: "-fc1" "-triple" "aarch64-unknown-linux-gnu" |
| 43 |
! CHECK-A76-SAME: "-target-cpu" "cortex-a76" |
| 44 |
! CHECK-A76-SAME: "-target-feature" "+v8.2a" "-target-feature" "+aes" "-target-feature" "+crc" "-target-feature" "+dotprod" "-target-feature" "+fp-armv8" "-target-feature" "+fullfp16" "-target-feature" "+lse" "-target-feature" "+neon" "-target-feature" "+perfmon" "-target-feature" "+ras" "-target-feature" "+rcpc" "-target-feature" "+rdm" "-target-feature" "+sha2" "-target-feature" "+ssbs" |
| 45 |
|
| 46 |
! CHECK-ARMV9: "-fc1" "-triple" "aarch64-unknown-linux-gnu" |
| 47 |
! CHECK-ARMV9-SAME: "-target-cpu" "generic" |
| 48 |
! CHECK-ARMV9-SAME: "-target-feature" "+v9a" |
| 49 |
! CHECK-ARMV9-SAME: "-target-feature" "+sve" |
| 50 |
! CHECK-ARMV9-SAME: "-target-feature" "+sve2" |
| 51 |
|
| 52 |
! CHECK-NO-A57: "-fc1" "-triple" "x86_64-unknown-linux-gnu" |
| 53 |
! CHECK-NO-A57-NOT: cortex-a57 |
| 54 |
! CHECK-NO-A57-SAME: "-target-cpu" "x86-64" |
| 55 |
! CHECK-NO-A57-NOT: cortex-a57 |
| 56 |
|
| 57 |
! CHECK-SKYLAKE: "-fc1" "-triple" "x86_64-unknown-linux-gnu" |
| 58 |
! CHECK-SKYLAKE-SAME: "-target-cpu" "skylake" |
| 59 |
|
| 60 |
! CHECK-APX: "-fc1" "-triple" "x86_64-unknown-linux-gnu" |
| 61 |
! CHECK-APX-SAME: "-target-feature" "+egpr" |
| 62 |
|
| 63 |
! CHECK-NO-APX: "-fc1" "-triple" "x86_64-unknown-linux-gnu" |
| 64 |
! CHECK-NO-APX-SAME: "-target-feature" "-ccmp" |
| 65 |
|
| 66 |
! CHECK-X86_64H: "-fc1" "-triple" "x86_64h-unknown-linux-gnu" |
| 67 |
! CHECK-X86_64H-SAME: "-target-cpu" "x86-64" "-target-feature" "-rdrnd" "-target-feature" "-aes" "-target-feature" "-pclmul" "-target-feature" "-rtm" "-target-feature" "-fsgsbase" |
| 68 |
|
| 69 |
! CHECK-RV64: "-fc1" "-triple" "riscv64-unknown-linux-gnu" |
| 70 |
! CHECK-RV64-SAME: "-target-cpu" "generic-rv64" "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+c" |
| 71 |
|
| 72 |
! CHECK-AMDGPU: "-fc1" "-triple" "amdgcn-amd-amdhsa" |
| 73 |
! CHECK-AMDGPU-SAME: "-target-cpu" "gfx908" |
| 74 |
|
| 75 |
! CHECK-AMDGPU-R600: "-fc1" "-triple" "r600-unknown-unknown" |
| 76 |
! CHECK-AMDGPU-R600-SAME: "-target-cpu" "cayman" |