[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / hip-toolchain-opt.hip
blobb104f6fff2034fcfdea6c29b8a6f98190f2cf98c
1 // RUN: %clang -### \
2 // RUN:   --target=x86_64-unknown-linux-gnu \
3 // RUN:   --cuda-gpu-arch=gfx900 \
4 // RUN:   -c -nogpuinc -nogpulib \
5 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
6 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,DEFAULT %s
8 // RUN: %clang -### -O0 \
9 // RUN:   --target=x86_64-unknown-linux-gnu \
10 // RUN:   --cuda-gpu-arch=gfx900 \
11 // RUN:   -c -nogpuinc -nogpulib \
12 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
13 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O0 %s
15 // RUN: %clang -### -O1 \
16 // RUN:   --target=x86_64-unknown-linux-gnu \
17 // RUN:   --cuda-gpu-arch=gfx900 \
18 // RUN:   -c -nogpuinc -nogpulib \
19 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
20 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O1 %s
22 // RUN: %clang -### -O2 \
23 // RUN:   --target=x86_64-unknown-linux-gnu \
24 // RUN:   --cuda-gpu-arch=gfx900 \
25 // RUN:   -c -nogpuinc -nogpulib \
26 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
27 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O2 %s
29 // RUN: %clang -### -O3 \
30 // RUN:   --target=x86_64-unknown-linux-gnu \
31 // RUN:   --cuda-gpu-arch=gfx900 \
32 // RUN:   -c -nogpuinc -nogpulib \
33 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
34 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O3 %s
36 // RUN: %clang -### -Os \
37 // RUN:   --target=x86_64-unknown-linux-gnu \
38 // RUN:   --cuda-gpu-arch=gfx900 \
39 // RUN:   -c -nogpuinc -nogpulib \
40 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
41 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Os %s
43 // RUN: %clang -### -Oz \
44 // RUN:   --target=x86_64-unknown-linux-gnu \
45 // RUN:   --cuda-gpu-arch=gfx900 \
46 // RUN:   -c -nogpuinc -nogpulib \
47 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
48 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Oz %s
50 // RUN: %clang -### -Og \
51 // RUN:   --target=x86_64-unknown-linux-gnu \
52 // RUN:   --cuda-gpu-arch=gfx900 \
53 // RUN:   -c -nogpuinc -nogpulib \
54 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
55 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,Og %s
57 // RUN: %clang -### -O0 \
58 // RUN:   -Xoffload-linker --lto-CGO2 \
59 // RUN:   --target=x86_64-unknown-linux-gnu \
60 // RUN:   --cuda-gpu-arch=gfx900 \
61 // RUN:   -c -nogpuinc -nogpulib \
62 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
63 // RUN: 2>&1 | FileCheck --check-prefixes=ALL,O0-CGO2 %s
65 // ALL: "-cc1" "-triple" "amdgcn-amd-amdhsa"
66 // DEFAULT-NOT: "-O{{.}}"
67 // O0-SAME: "-O0"
68 // O1-SAME: "-O1"
69 // O2-SAME: "-O2"
70 // O3-SAME: "-O3"
71 // Os-SAME: "-Os"
72 // Oz-SAME: "-Oz"
73 // Og-SAME: "-Og"
74 // O0-CGO2-SAME: "-O0"
75 // O0-CGO2-NOT: "--lto-CGO2"
77 // ALL-NOT: "{{.*}}opt"
79 // ALL-NOT: "{{.*}}llc"
81 // ALL: "{{.*}}lld{{.*}}" {{.*}} "-plugin-opt=mcpu=gfx900"
82 // DEFAULT-NOT: "-plugin-opt=O{{.*}}"
83 // O0-SAME: "-plugin-opt=O0"
84 // O0-SAME: "--lto-CGO0"
85 // O1-SAME: "-plugin-opt=O1"
86 // O1-SAME: "--lto-CGO1"
87 // O2-SAME: "-plugin-opt=O2"
88 // O2-SAME: "--lto-CGO2"
89 // O3-SAME: "-plugin-opt=O3"
90 // O3-SAME: "--lto-CGO3"
91 // Os-SAME: "-plugin-opt=O2"
92 // Os-SAME: "--lto-CGO2"
93 // Oz-SAME: "-plugin-opt=O2"
94 // Oz-SAME: "--lto-CGO2"
95 // Og-SAME: "-plugin-opt=O1"
96 // Og-SAME: "--lto-CGO1"
97 // O0-CGO2-SAME: "-plugin-opt=O0"
98 // O0-CGO2-SAME: "--lto-CGO0"
99 // O0-CGO2-SAME: "--lto-CGO2"
101 // ALL: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
102 // DEFAULT-NOT: "-O{{.}}"
103 // O0-SAME: "-O0"
104 // O1-SAME: "-O1"
105 // O2-SAME: "-O2"
106 // O3-SAME: "-O3"
107 // Os-SAME: "-Os"
108 // Oz-SAME: "-Oz"
109 // Og-SAME: "-Og"
110 // O0-CGO2-SAME: "-O0"
111 // O0-CGO2-NOT: "--lto-CGO2"