xref: /llvm-project/clang/test/Driver/hip-toolchain-features.hip (revision 12949c952c4fbad776a860c003ccf176973278a0)
1// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
2// RUN:   -nogpuinc --offload-arch=gfx906:xnack+ --offload-arch=gfx900:xnack+ %s \
3// RUN:   2>&1 | FileCheck %s -check-prefix=XNACK
4// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
5// RUN:   -nogpuinc --offload-arch=gfx906:xnack- --offload-arch=gfx900:xnack- %s \
6// RUN:   2>&1 | FileCheck %s -check-prefix=NOXNACK
7
8// XNACK: {{.*}}clang{{.*}}"-target-feature" "+xnack"
9// NOXNACK: {{.*}}clang{{.*}}"-target-feature" "-xnack"
10// XNACK: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+xnack"
11// NOXNACK: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-xnack"
12
13// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
14// RUN:   -nogpuinc --offload-arch=gfx908:sramecc+ --no-offload-new-driver %s \
15// RUN:   2>&1 | FileCheck %s -check-prefix=SRAM
16// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
17// RUN:   -nogpuinc --offload-arch=gfx908:sramecc- --no-offload-new-driver %s \
18// RUN:   2>&1 | FileCheck %s -check-prefix=NOSRAM
19
20// SRAM: {{.*}}clang{{.*}}"-target-feature" "+sramecc"
21// NOSRAM: {{.*}}clang{{.*}}"-target-feature" "-sramecc"
22// SRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+sramecc"
23// NOTSRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-sramecc"
24
25// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
26// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
27// RUN:   -mcumode  2>&1 | FileCheck %s -check-prefix=CUMODE
28// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
29// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
30// RUN:   -mno-cumode  2>&1 | FileCheck %s -check-prefix=NOTCUMODE
31
32// CUMODE: {{.*}}clang{{.*}}"-target-feature" "+cumode"
33// NOTCUMODE: {{.*}}clang{{.*}}"-target-feature" "-cumode"
34// CUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode"
35// NOTCUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-cumode"
36
37// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
38// RUN:   -nogpuinc --offload-arch=gfx908:xnack+:sramecc+ --no-offload-new-driver %s \
39// RUN:   2>&1 | FileCheck %s -check-prefix=ALL3
40// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
41// RUN:   -nogpuinc --offload-arch=gfx908:xnack-:sramecc- --no-offload-new-driver %s \
42// RUN:   2>&1 | FileCheck %s -check-prefix=NOALL3
43
44// ALL3: {{.*}}clang{{.*}}"-target-feature" "+sramecc" "-target-feature" "+xnack"
45// NOALL3: {{.*}}clang{{.*}}"-target-feature" "-sramecc" "-target-feature" "-xnack"
46
47// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
48// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
49// RUN:   -mtgsplit  2>&1 | FileCheck %s -check-prefix=TGSPLIT
50// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
51// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
52// RUN:   -mno-tgsplit  2>&1 | FileCheck %s -check-prefix=NOTTGSPLIT
53
54// TGSPLIT: {{.*}}clang{{.*}}"-target-feature" "+tgsplit"
55// NOTTGSPLIT: {{.*}}clang{{.*}}"-target-feature" "-tgsplit"
56// TGSPLIT: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+tgsplit"
57// NOTTGSPLIT: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-tgsplit"
58
59// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
60// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
61// RUN:   -mcumode -mcumode -mno-cumode -mwavefrontsize64 -mcumode \
62// RUN:   -mwavefrontsize64 -mno-wavefrontsize64 2>&1 \
63// RUN:   | FileCheck %s -check-prefix=DUP
64// DUP: {{.*}}clang{{.*}} "-target-feature" "+cumode"
65// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize16"
66// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize32"
67// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize64"
68// DUP: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode"
69
70// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
71// RUN:   -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
72// RUN:   -mno-wavefrontsize64 -mwavefrontsize64 2>&1 \
73// RUN:   | FileCheck %s -check-prefix=WAVE64
74// WAVE64: {{.*}}clang{{.*}} "-target-feature" "+wavefrontsize64"
75// WAVE64-NOT: "-target-feature" "{{.*}}wavefrontsize16"
76// WAVE64-NOT: "-target-feature" "{{.*}}wavefrontsize32"
77// WAVE64: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+wavefrontsize64"
78