• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: clang-driver
2// REQUIRES: x86-registered-target
3// REQUIRES: amdgpu-registered-target
4
5// RUN: %clang -### \
6// RUN:   -target x86_64-unknown-linux-gnu \
7// RUN:   --cuda-gpu-arch=gfx900 \
8// RUN:   -c -nogpulib \
9// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
10// RUN: 2>&1 | FileCheck --check-prefixes=ALL,DEFAULT %s
11
12// RUN: %clang -### -O0 \
13// RUN:   -target x86_64-unknown-linux-gnu \
14// RUN:   --cuda-gpu-arch=gfx900 \
15// RUN:   -c -nogpulib \
16// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
17// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O0 %s
18
19// RUN: %clang -### -O1 \
20// RUN:   -target x86_64-unknown-linux-gnu \
21// RUN:   --cuda-gpu-arch=gfx900 \
22// RUN:   -c -nogpulib \
23// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
24// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O1 %s
25
26// RUN: %clang -### -O2 \
27// RUN:   -target x86_64-unknown-linux-gnu \
28// RUN:   --cuda-gpu-arch=gfx900 \
29// RUN:   -c -nogpulib \
30// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
31// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O2 %s
32
33// RUN: %clang -### -O3 \
34// RUN:   -target x86_64-unknown-linux-gnu \
35// RUN:   --cuda-gpu-arch=gfx900 \
36// RUN:   -c -nogpulib \
37// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
38// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O3 %s
39
40// RUN: %clang -### -Os \
41// RUN:   -target x86_64-unknown-linux-gnu \
42// RUN:   --cuda-gpu-arch=gfx900 \
43// RUN:   -c -nogpulib \
44// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
45// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Os %s
46
47// RUN: %clang -### -Oz \
48// RUN:   -target x86_64-unknown-linux-gnu \
49// RUN:   --cuda-gpu-arch=gfx900 \
50// RUN:   -c -nogpulib \
51// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
52// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Oz %s
53
54// RUN: %clang -### -Og \
55// RUN:   -target x86_64-unknown-linux-gnu \
56// RUN:   --cuda-gpu-arch=gfx900 \
57// RUN:   -c -nogpulib \
58// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
59// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Og %s
60
61// ALL: "{{.*}}clang{{.*}}" "-cc1" "-mllvm" "--amdhsa-code-object-version=4" "-triple" "amdgcn-amd-amdhsa"
62// DEFAULT-NOT: "-O{{.}}"
63// O0-SAME: "-O0"
64// O1-SAME: "-O1"
65// O2-SAME: "-O2"
66// O3-SAME: "-O3"
67// Os-SAME: "-Os"
68// Oz-SAME: "-Oz"
69// Og-SAME: "-Og"
70
71// ALL-NOT: "{{.*}}opt"
72
73// ALL-NOT: "{{.*}}llc"
74
75// ALL: "{{.*}}lld{{.*}}" {{.*}} "-plugin-opt=mcpu=gfx900"
76// DEFAULT-NOT: "-plugin-opt=O{{.*}}"
77// O0-SAME: "-plugin-opt=O0"
78// O1-SAME: "-plugin-opt=O1"
79// O2-SAME: "-plugin-opt=O2"
80// O3-SAME: "-plugin-opt=O3"
81// Os-SAME: "-plugin-opt=O2"
82// Oz-SAME: "-plugin-opt=O2"
83// Og-SAME: "-plugin-opt=O1"
84
85// ALL: "{{.*}}clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-linux-gnu"
86// DEFAULT-NOT: "-O{{.}}"
87// O0-SAME: "-O0"
88// O1-SAME: "-O1"
89// O2-SAME: "-O2"
90// O3-SAME: "-O3"
91// Os-SAME: "-Os"
92// Oz-SAME: "-Oz"
93// Og-SAME: "-Og"
94