Clang Project

clang_source_code/test/Driver/hip-toolchain-features.hip
1// REQUIRES: clang-driver
2// REQUIRES: x86-registered-target
3// REQUIRES: amdgpu-registered-target
4
5// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
6// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
7// RUN:   -mxnack 2>&1 | FileCheck %s -check-prefix=XNACK
8// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
9// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
10// RUN:   -mno-xnack 2>&1 | FileCheck %s -check-prefix=NOXNACK
11
12// XNACK: {{.*}}clang{{.*}}"-target-feature" "+xnack"
13// NOXNACK: {{.*}}clang{{.*}}"-target-feature" "-xnack"
14
15
16// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
17// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
18// RUN:   -msram-ecc 2>&1 | FileCheck %s -check-prefix=SRAM
19// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
20// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
21// RUN:   -mno-sram-ecc 2>&1 | FileCheck %s -check-prefix=NOSRAM
22
23// SRAM: {{.*}}clang{{.*}}"-target-feature" "+sram-ecc"
24// NOSRAM: {{.*}}clang{{.*}}"-target-feature" "-sram-ecc"
25
26
27// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
28// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
29// RUN:   -mxnack -msram-ecc \
30// RUN:   2>&1 | FileCheck %s -check-prefix=ALL3
31// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
32// RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
33// RUN:   -mno-xnack -mno-sram-ecc \
34// RUN:   2>&1 | FileCheck %s -check-prefix=NOALL3
35
36// ALL3: {{.*}}clang{{.*}}"-target-feature" "+xnack" "-target-feature" "+sram-ecc"
37// NOALL3: {{.*}}clang{{.*}}"-target-feature" "-xnack" "-target-feature" "-sram-ecc"
38