| 1 |
// RUN: %clang -### -x hip -nogpulib -nogpuinc --gpu-max-threads-per-block=1024 %s 2>&1 | FileCheck %s |
| 2 |
|
| 3 |
// Check that there are commands for both host- and device-side compilations. |
| 4 |
// |
| 5 |
// CHECK: "-cc1" {{.*}} "-fcuda-is-device" |
| 6 |
// CHECK-SAME: "--gpu-max-threads-per-block=1024" |
| 7 |
|
| 8 |
// RUN: %clang -### -nogpuinc -nogpulib -fgpu-allow-device-init \ |
| 9 |
// RUN: %s 2>&1 | FileCheck -check-prefix=DEVINIT %s |
| 10 |
// DEVINIT: "-cc1" {{.*}}"-fgpu-allow-device-init" |
| 11 |
// DEVINIT: "-cc1" {{.*}}"-fgpu-allow-device-init" |
| 12 |
|
| 13 |
// Check -fgpu-default-stream=per-thread. |
| 14 |
// RUN: %clang -### -nogpuinc -nogpulib -fgpu-default-stream=per-thread \ |
| 15 |
// RUN: %s -save-temps 2>&1 | FileCheck -check-prefix=PTH %s |
| 16 |
// PTH: "-cc1"{{.*}} "-E" {{.*}}"-fgpu-default-stream=per-thread" |
| 17 |
// PTH: "-cc1"{{.*}} "-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output" |
| 18 |
// PTH: "-cc1"{{.*}} "-E" {{.*}}"-fgpu-default-stream=per-thread" |
| 19 |
// PTH: "-cc1"{{.*}} "-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output" |
| 20 |
|
| 21 |
// Check -mprintf-kind=hostcall |
| 22 |
// RUN: %clang -### -nogpulib -nogpuinc --target=x86_64-unknown-linux-gnu -mprintf-kind=hostcall %s -save-temps 2>&1 | FileCheck -check-prefix=HOSTC %s |
| 23 |
// HOSTC: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-mprintf-kind=hostcall" "-Werror=format-invalid-specifier"{{.*}}"-E" {{.*}} |
| 24 |
// HOSTC: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}} "-mprintf-kind=hostcall" "-Werror=format-invalid-specifier" {{.*}}"-x" "hip-cpp-output" |
| 25 |
// HOSTC: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}} "-mprintf-kind=hostcall" "-Werror=format-invalid-specifier" {{.*}}"-x" "ir" |
| 26 |
// HOSTC: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}} "-E" {{.*}} |
| 27 |
// HOSTC: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-x" "ir" |
| 28 |
|
| 29 |
// Check -mprintf-kind=buffered |
| 30 |
// RUN: %clang -### -nogpulib -nogpuinc --target=x86_64-unknown-linux-gnu -mprintf-kind=buffered %s -save-temps 2>&1 | FileCheck -check-prefix=BUFF %s |
| 31 |
// BUFF: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-mprintf-kind=buffered" "-Werror=format-invalid-specifier"{{.*}}"-E" {{.*}} |
| 32 |
// BUFF: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}} "-mprintf-kind=buffered" "-Werror=format-invalid-specifier" {{.*}}"-x" "hip-cpp-output" |
| 33 |
// BUFF: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}} "-mprintf-kind=buffered" "-Werror=format-invalid-specifier" {{.*}}"-x" "ir" |
| 34 |
// BUFF: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}} "-E" {{.*}} |
| 35 |
// BUFF: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-x" "ir" |
| 36 |
|
| 37 |
// RUN: %clang -### -x hip -nogpulib -nogpuinc --target=x86_64-pc-windows-msvc -fms-extensions \ |
| 38 |
// RUN: -mllvm -amdgpu-early-inline-all=true %s 2>&1 | \ |
| 39 |
// RUN: FileCheck -check-prefix=MLLVM %s |
| 40 |
// MLLVM-NOT: "-mllvm"{{.*}}"-amdgpu-early-inline-all=true"{{.*}}"-mllvm"{{.*}}"-amdgpu-early-inline-all=true" |
| 41 |
|
| 42 |
// RUN: %clang -### -Xarch_device -g -nogpulib -nogpuinc --cuda-gpu-arch=gfx900 \ |
| 43 |
// RUN: -Xarch_device -fcf-protection=branch -Xarch_device -mllvm=--inline-threshold=100 \ |
| 44 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEV %s |
| 45 |
// DEV: "-cc1"{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch" {{.*}}"-mllvm" "--inline-threshold=100" |
| 46 |
// DEV: "-cc1"{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch" {{.*}}"-mllvm" "--inline-threshold=100" |
| 47 |
// DEV-NOT: clang{{.*}} {{.*}} "-debug-info-kind={{.*}}" |
| 48 |
|
| 49 |
// RUN: %clang -### -Xarch_host -g -nogpulib -nogpuinc --cuda-gpu-arch=gfx900 \ |
| 50 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=HOST %s |
| 51 |
// HOST-NOT: "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" |
| 52 |
// HOST-NOT: "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" |
| 53 |
// HOST: clang{{.*}} "-debug-info-kind={{.*}}" |
| 54 |
|
| 55 |
// RUN: %clang -### -nogpuinc -nogpulib -munsafe-fp-atomics \ |
| 56 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=UNSAFE-FP-ATOMICS %s |
| 57 |
// UNSAFE-FP-ATOMICS: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fatomic-ignore-denormal-mode" |
| 58 |
|
| 59 |
// RUN: %clang -### -nogpuinc -nogpulib \ |
| 60 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEFAULT-UNSAFE-FP-ATOMICS %s |
| 61 |
// DEFAULT-UNSAFE-FP-ATOMICS-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fatomic-ignore-denormal-mode" |
| 62 |
|
| 63 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fgpu-exclude-wrong-side-overloads \ |
| 64 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=FIX-OVERLOAD %s |
| 65 |
// FIX-OVERLOAD: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag" |
| 66 |
// FIX-OVERLOAD: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag" |
| 67 |
|
| 68 |
// Check -mconstructor-aliases is not passed to device compilation. |
| 69 |
|
| 70 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 71 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=CTA %s |
| 72 |
// CTA: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-mconstructor-aliases" |
| 73 |
// CTA-NOT: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mconstructor-aliases" |
| 74 |
|
| 75 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 76 |
// RUN: --offload-arch=gfx906 -fgpu-inline-threshold=1000 %s 2>&1 | FileCheck -check-prefix=THRESH %s |
| 77 |
// THRESH: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mllvm" "-inline-threshold=1000" |
| 78 |
// THRESH-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-inline-threshold=1000" |
| 79 |
|
| 80 |
// Check -foffload-lto=thin translated correctly. |
| 81 |
|
| 82 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 83 |
// RUN: --cuda-gpu-arch=gfx906 -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \ |
| 84 |
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s |
| 85 |
|
| 86 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 87 |
// RUN: --cuda-gpu-arch=gfx906 -fgpu-rdc -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \ |
| 88 |
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s |
| 89 |
|
| 90 |
// Ensure we don't error about -fwhole-program-vtables for the non-device offload compile. |
| 91 |
// HIPTHINLTO-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto' |
| 92 |
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit" |
| 93 |
// HIPTHINLTO: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-flto=thin" "-flto-unit" {{.*}} "-fwhole-program-vtables" |
| 94 |
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit" |
| 95 |
// HIPTHINLTO: lld{{.*}}"-plugin-opt=mcpu=gfx906" "-plugin-opt=thinlto" "-plugin-opt=-force-import-all" |
| 96 |
|
| 97 |
// Check that -flto=thin is handled correctly, particularly with -fwhole-program-vtables. |
| 98 |
// |
| 99 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 100 |
// RUN: --cuda-gpu-arch=gfx906 -flto=thin -fwhole-program-vtables %s 2>&1 \ |
| 101 |
// RUN: | FileCheck -check-prefix=THINLTO %s |
| 102 |
|
| 103 |
// Ensure we don't error about -fwhole-program-vtables for the device offload compile. We should |
| 104 |
// drop -fwhole-program-vtables for the device offload compile and pass it through for the |
| 105 |
// non-device offload compile along with -flto=thin. |
| 106 |
// THINLTO-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto' |
| 107 |
// THINLTO-NOT: "-cc1"{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables" |
| 108 |
// THINLTO: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto=thin" {{.*}} "-fwhole-program-vtables" |
| 109 |
// THINLTO-NOT: "-cc1"{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables" |
| 110 |
|
| 111 |
// Check -fopenmp=libomp is allowed with HIP but -fopenmp-targets= is not allowed. |
| 112 |
|
| 113 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 114 |
// RUN: --offload-arch=gfx906 -fopenmp=libomp %s 2>&1 | FileCheck -check-prefix=OMP %s |
| 115 |
// OMP-NOT: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fopenmp" |
| 116 |
// OMP: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fopenmp" |
| 117 |
|
| 118 |
// Check -Xoffload-linker option is passed to lld. |
| 119 |
|
| 120 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 121 |
// RUN: --cuda-gpu-arch=gfx906 -fgpu-rdc -Xoffload-linker --build-id=md5 %s 2>&1 \ |
| 122 |
// RUN: | FileCheck -check-prefix=OFL-LINK %s |
| 123 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 124 |
// RUN: --cuda-gpu-arch=gfx906 -Xoffload-linker --build-id=md5 %s 2>&1 \ |
| 125 |
// RUN: | FileCheck -check-prefix=OFL-LINK %s |
| 126 |
// OFL-LINK: lld{{.*}}"--build-id=md5" |
| 127 |
|
| 128 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 129 |
// RUN: --offload-arch=gfx906 -fhip-kernel-arg-name %s 2>&1 \ |
| 130 |
// RUN: | FileCheck -check-prefix=KAN %s |
| 131 |
// KAN: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fhip-kernel-arg-name" |
| 132 |
|
| 133 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 134 |
// RUN: --offload-arch=gfx906 %s 2>&1 \ |
| 135 |
// RUN: | FileCheck -check-prefix=KANNEG %s |
| 136 |
// KANNEG-NOT: "-fhip-kernel-arg-name" |
| 137 |
|
| 138 |
// RUN: %clang -### -nogpuinc -nogpulib -mno-amdgpu-ieee -mamdgpu-ieee \ |
| 139 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=IEEE-ON %s |
| 140 |
// IEEE-ON-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-m{{(no-)?}}amdgpu-ieee" |
| 141 |
|
| 142 |
// RUN: %clang -### -nogpuinc -nogpulib -mamdgpu-ieee -mno-amdgpu-ieee -ffast-math \ |
| 143 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=IEEE-OFF %s |
| 144 |
// IEEE-OFF: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mno-amdgpu-ieee" |
| 145 |
|
| 146 |
// RUN: %clang -### -nogpuinc -nogpulib -mamdgpu-ieee -mno-amdgpu-ieee -ffast-math \ |
| 147 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=IEEE-OFF-NEG %s |
| 148 |
// IEEE-OFF-NEG-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mamdgpu-ieee" |
| 149 |
|
| 150 |
// Check -fno-hip-fp32-correctly-rounded-divide-sqrt is passed to -cc1 but |
| 151 |
// (default) -fhip-fp32-correctly-rounded-divide-sqrt is not. |
| 152 |
|
| 153 |
// RUN: %clang -### -nogpuinc -nogpulib -fno-hip-fp32-correctly-rounded-divide-sqrt \ |
| 154 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=NOCRDS %s |
| 155 |
// NOCRDS: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fno-hip-fp32-correctly-rounded-divide-sqrt" |
| 156 |
|
| 157 |
// RUN: %clang -### -nogpuinc -nogpulib \ |
| 158 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=CRDS %s |
| 159 |
// CRDS-NOT: "-f{{(no-)?}}hip-fp32-correctly-rounded-divide-sqrt" |
| 160 |
|
| 161 |
// RUN: %clang -### -nogpuinc -nogpulib -fhip-fp32-correctly-rounded-divide-sqrt \ |
| 162 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=CRDS %s |
| 163 |
// CRDS-NOT: "-f{{(no-)?}}hip-fp32-correctly-rounded-divide-sqrt" |
| 164 |
|
| 165 |
// Check -fgpu-approx-transcendentals is passed to clang -cc1 but |
| 166 |
// (default) -fno-gpu-approx-transcendentals is not. |
| 167 |
// -ffast-math implies -fgpu-approx-transcendentals, which can be overridden |
| 168 |
// by -fno-gpu-approx-transcendentals. |
| 169 |
|
| 170 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fgpu-approx-transcendentals \ |
| 171 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=APPROX %s |
| 172 |
|
| 173 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -ffast-math \ |
| 174 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=APPROX %s |
| 175 |
|
| 176 |
// APPROX: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fgpu-approx-transcendentals" |
| 177 |
// APPROX: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fgpu-approx-transcendentals" |
| 178 |
|
| 179 |
// RUN: %clang -### -nogpuinc -nogpulib -fno-gpu-approx-transcendentals \ |
| 180 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOAPPROX %s |
| 181 |
|
| 182 |
// RUN: %clang -### -nogpuinc -nogpulib \ |
| 183 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOAPPROX %s |
| 184 |
|
| 185 |
// RUN: %clang -### -nogpuinc -nogpulib -ffast-math -fno-fast-math \ |
| 186 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOAPPROX %s |
| 187 |
|
| 188 |
// RUN: %clang -### -nogpuinc -nogpulib -ffast-math -fno-gpu-approx-transcendentals \ |
| 189 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOAPPROX %s |
| 190 |
|
| 191 |
// NOAPPROX-NOT: "-f{{(no-)?}}gpu-approx-transcendentals" |
| 192 |
|
| 193 |
// Check no warnings for -fgpu-approx-transcendentals. |
| 194 |
|
| 195 |
// RUN: %clang -fdriver-only -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fgpu-approx-transcendentals \ |
| 196 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | count 0 |
| 197 |
|
| 198 |
// RUN: %clang -fdriver-only -Werror --target=x86_64-unknown-linux-gnu -nostdinc -nostdlib -fgpu-approx-transcendentals \ |
| 199 |
// RUN: -x c++ %s 2>&1 | count 0 |
| 200 |
/ Check -fno-offload-uniform-block is passed to clang -cc1 but |
| 201 |
// (default) -fno-offload-uniform-block is not. |
| 202 |
|
| 203 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fno-offload-uniform-block \ |
| 204 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOUNIBLK %s |
| 205 |
|
| 206 |
// NOUNIBLK: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fno-offload-uniform-block" |
| 207 |
// NOUNIBLK: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fno-offload-uniform-block" |
| 208 |
|
| 209 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -foffload-uniform-block \ |
| 210 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=UNIBLK %s |
| 211 |
|
| 212 |
// UNIBLK: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-foffload-uniform-block" |
| 213 |
// UNIBLK: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-foffload-uniform-block" |
| 214 |
|
| 215 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 216 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEFUNIBLK %s |
| 217 |
|
| 218 |
// DEFUNIBLK-NOT: "-f{{(no-)?}}offload-uniform-block" |
| 219 |
|
| 220 |
// Check no warnings for -f[no-]offload-uniform-block. |
| 221 |
|
| 222 |
// RUN: %clang -fdriver-only -c -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fno-offload-uniform-block \ |
| 223 |
// RUN: -foffload-uniform-block --cuda-gpu-arch=gfx906 %s 2>&1 | count 0 |
| 224 |
|
| 225 |
// Check -Werror=atomic-alignment is passed for amdpu by default. |
| 226 |
|
| 227 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 228 |
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=WARN-ATOMIC %s |
| 229 |
// WARN-ATOMIC: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-Werror=atomic-alignment" |
| 230 |
// WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Werror=atomic-alignment" |
| 231 |
|
| 232 |
// Check the default -Werror=atomic-alignment can be overridden. |
| 233 |
|
| 234 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 235 |
// RUN: --cuda-gpu-arch=gfx906 -Xarch_device -Wno-error=atomic-alignment %s \ |
| 236 |
// RUN: 2>&1 | FileCheck -check-prefix=NO-WARN-ATOMIC %s |
| 237 |
// NO-WARN-ATOMIC: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-Werror=atomic-alignment" {{.*}} "-Wno-error=atomic-alignment" |
| 238 |
// NO-WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Werror=atomic-alignment" |
| 239 |
// NO-WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Wno-error=atomic-alignment" |
| 240 |
|
| 241 |
// Check --offload-compress --offload-jobs=N does not cause warning. |
| 242 |
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 243 |
// RUN: --offload-arch=gfx1100 --offload-compress --offload-host-only -M %s \ |
| 244 |
// RUN: --offload-jobs=4 --offload-new-driver |
| 245 |
|
| 246 |
// Check --offload-jobs=N option. |
| 247 |
|
| 248 |
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 249 |
// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=4 %s 2>&1 | \ |
| 250 |
// RUN: FileCheck -check-prefix=JOBS %s |
| 251 |
// JOBS: clang-linker-wrapper{{.*}} "--wrapper-jobs=4" |
| 252 |
|
| 253 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 254 |
// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=0x4 %s 2>&1 | \ |
| 255 |
// RUN: FileCheck -check-prefix=INVJOBS %s |
| 256 |
// INVJOBS: clang: error: invalid integral value '0x4' in '--offload-jobs=0x4' |
| 257 |
|
| 258 |
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \ |
| 259 |
// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=jobserver %s 2>&1 | \ |
| 260 |
// RUN: FileCheck -check-prefix=JOBSV %s |
| 261 |
// JOBSV: clang-linker-wrapper{{.*}} "--wrapper-jobs=jobserver" |
| 262 |
|