[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Driver / target-cpu-features.f90
blob5a3fd0d8380027c568a4c01a37e8f6568eb634e0
1 ! Test that -mcpu/march are used and that the -target-cpu and -target-features
2 ! are also added to the fc1 command.
4 ! RUN: %flang --target=aarch64-linux-gnu -mcpu=cortex-a57 -c %s -### 2>&1 \
5 ! RUN: | FileCheck %s -check-prefix=CHECK-A57
7 ! RUN: %flang --target=aarch64-linux-gnu -mcpu=cortex-a76 -c %s -### 2>&1 \
8 ! RUN: | FileCheck %s -check-prefix=CHECK-A76
10 ! RUN: %flang --target=aarch64-linux-gnu -march=armv9 -c %s -### 2>&1 \
11 ! RUN: | FileCheck %s -check-prefix=CHECK-ARMV9
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
17 ! RUN: %flang --target=x86_64-linux-gnu -march=skylake -c %s -### 2>&1 \
18 ! RUN: | FileCheck %s -check-prefix=CHECK-SKYLAKE
20 ! RUN: %flang --target=x86_64-linux-gnu -mapx-features=egpr -c %s -### 2>&1 \
21 ! RUN: | FileCheck %s -check-prefix=CHECK-APX
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
26 ! RUN: %flang --target=x86_64-linux-gnu -mevex512 -c %s -### 2>&1 \
27 ! RUN: | FileCheck %s -check-prefix=CHECK-EVEX512
29 ! RUN: %flang --target=x86_64-linux-gnu -mno-evex512 -c %s -### 2>&1 \
30 ! RUN: | FileCheck %s -check-prefix=CHECK-NO-EVEX512
32 ! RUN: %flang --target=x86_64h-linux-gnu -c %s -### 2>&1 \
33 ! RUN: | FileCheck %s -check-prefix=CHECK-X86_64H
35 ! RUN: %flang --target=riscv64-linux-gnu -c %s -### 2>&1 \
36 ! RUN: | FileCheck %s -check-prefix=CHECK-RV64
38 ! RUN: %flang --target=amdgcn-amd-amdhsa -mcpu=gfx908 -nogpulib -c %s -### 2>&1 \
39 ! RUN: | FileCheck %s -check-prefix=CHECK-AMDGPU
41 ! RUN: %flang --target=r600-unknown-unknown -mcpu=cayman -nogpulib -c %s -### 2>&1 \
42 ! RUN: | FileCheck %s -check-prefix=CHECK-AMDGPU-R600
44 ! RUN: %flang --target=loongarch64-linux-gnu -c %s -### 2>&1 \
45 ! RUN: | FileCheck %s -check-prefix=CHECK-LOONGARCH64
47 ! CHECK-A57: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
48 ! CHECK-A57-SAME: "-target-cpu" "cortex-a57"
49 ! 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
51 ! CHECK-A76: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
52 ! CHECK-A76-SAME: "-target-cpu" "cortex-a76"
53 ! 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"
55 ! CHECK-ARMV9: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
56 ! CHECK-ARMV9-SAME: "-target-cpu" "generic"
57 ! CHECK-ARMV9-SAME: "-target-feature" "+v9a"
58 ! CHECK-ARMV9-SAME: "-target-feature" "+sve"
59 ! CHECK-ARMV9-SAME: "-target-feature" "+sve2"
61 ! CHECK-NO-A57: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
62 ! CHECK-NO-A57-NOT: cortex-a57
63 ! CHECK-NO-A57-SAME: "-target-cpu" "x86-64"
64 ! CHECK-NO-A57-NOT: cortex-a57
66 ! CHECK-SKYLAKE: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
67 ! CHECK-SKYLAKE-SAME: "-target-cpu" "skylake"
69 ! CHECK-APX: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
70 ! CHECK-APX-SAME: "-target-feature" "+egpr"
72 ! CHECK-NO-APX: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
73 ! CHECK-NO-APX-SAME: "-target-feature" "-ccmp"
75 ! CHECK-EVEX512: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
76 ! CHECK-EVEX512-SAME: "-target-feature" "+evex512"
78 ! CHECK-NO-EVEX512: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
79 ! CHECK-NO-EVEX512-SAME: "-target-feature" "-evex512"
81 ! CHECK-X86_64H: "-fc1" "-triple" "x86_64h-unknown-linux-gnu"
82 ! CHECK-X86_64H-SAME: "-target-cpu" "x86-64" "-target-feature" "-rdrnd" "-target-feature" "-aes" "-target-feature" "-pclmul" "-target-feature" "-rtm" "-target-feature" "-fsgsbase"
84 ! CHECK-RV64: "-fc1" "-triple" "riscv64-unknown-linux-gnu"
85 ! CHECK-RV64-SAME: "-target-cpu" "generic-rv64" "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+c"
87 ! CHECK-AMDGPU: "-fc1" "-triple" "amdgcn-amd-amdhsa"
88 ! CHECK-AMDGPU-SAME: "-target-cpu" "gfx908"
90 ! CHECK-AMDGPU-R600: "-fc1" "-triple" "r600-unknown-unknown"
91 ! CHECK-AMDGPU-R600-SAME: "-target-cpu" "cayman"
93 ! CHECK-LOONGARCH64: "-fc1" "-triple" "loongarch64-unknown-linux-gnu"
94 ! CHECK-LOONGARCH64-SAME: "-target-cpu" "loongarch64" "-target-feature" "+lsx" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+ual"