[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / hip-toolchain-opt.hip
blob40cae56353b45a767fd17b7f4887be12814460a5
1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // RUN: %clang -### \
5 // RUN:   -target x86_64-unknown-linux-gnu \
6 // RUN:   --cuda-gpu-arch=gfx900 \
7 // RUN:   -c -nogpulib \
8 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
9 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,DEFAULT %s
11 // RUN: %clang -### -O0 \
12 // RUN:   -target x86_64-unknown-linux-gnu \
13 // RUN:   --cuda-gpu-arch=gfx900 \
14 // RUN:   -c -nogpulib \
15 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
16 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O0 %s
18 // RUN: %clang -### -O1 \
19 // RUN:   -target x86_64-unknown-linux-gnu \
20 // RUN:   --cuda-gpu-arch=gfx900 \
21 // RUN:   -c -nogpulib \
22 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
23 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O1 %s
25 // RUN: %clang -### -O2 \
26 // RUN:   -target x86_64-unknown-linux-gnu \
27 // RUN:   --cuda-gpu-arch=gfx900 \
28 // RUN:   -c -nogpulib \
29 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
30 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O2 %s
32 // RUN: %clang -### -O3 \
33 // RUN:   -target x86_64-unknown-linux-gnu \
34 // RUN:   --cuda-gpu-arch=gfx900 \
35 // RUN:   -c -nogpulib \
36 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
37 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O3 %s
39 // RUN: %clang -### -Os \
40 // RUN:   -target x86_64-unknown-linux-gnu \
41 // RUN:   --cuda-gpu-arch=gfx900 \
42 // RUN:   -c -nogpulib \
43 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
44 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Os %s
46 // RUN: %clang -### -Oz \
47 // RUN:   -target x86_64-unknown-linux-gnu \
48 // RUN:   --cuda-gpu-arch=gfx900 \
49 // RUN:   -c -nogpulib \
50 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
51 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Oz %s
53 // RUN: %clang -### -Og \
54 // RUN:   -target x86_64-unknown-linux-gnu \
55 // RUN:   --cuda-gpu-arch=gfx900 \
56 // RUN:   -c -nogpulib \
57 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
58 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Og %s
60 // ALL: "-cc1" "-triple" "amdgcn-amd-amdhsa"
61 // DEFAULT-NOT: "-O{{.}}"
62 // O0-SAME: "-O0"
63 // O1-SAME: "-O1"
64 // O2-SAME: "-O2"
65 // O3-SAME: "-O3"
66 // Os-SAME: "-Os"
67 // Oz-SAME: "-Oz"
68 // Og-SAME: "-Og"
70 // ALL-NOT: "{{.*}}opt"
72 // ALL-NOT: "{{.*}}llc"
74 // ALL: "{{.*}}lld{{.*}}" {{.*}} "-plugin-opt=mcpu=gfx900"
75 // DEFAULT-NOT: "-plugin-opt=O{{.*}}"
76 // O0-SAME: "-plugin-opt=O0"
77 // O1-SAME: "-plugin-opt=O1"
78 // O2-SAME: "-plugin-opt=O2"
79 // O3-SAME: "-plugin-opt=O3"
80 // Os-SAME: "-plugin-opt=O2"
81 // Oz-SAME: "-plugin-opt=O2"
82 // Og-SAME: "-plugin-opt=O1"
84 // ALL: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
85 // DEFAULT-NOT: "-O{{.}}"
86 // O0-SAME: "-O0"
87 // O1-SAME: "-O1"
88 // O2-SAME: "-O2"
89 // O3-SAME: "-O3"
90 // Os-SAME: "-Os"
91 // Oz-SAME: "-Oz"
92 // Og-SAME: "-Og"