1 // RUN: %clang -### --target=x86_64-linux-gnu \
3 // RUN: --offload-arch=gfx908:xnack+:sramecc+ \
4 // RUN: --offload-arch=gfx908:xnack+:sramecc- \
5 // RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
6 // RUN: %s 2>&1 | FileCheck %s
8 // RUN: %clang -### --target=x86_64-linux-gnu \
10 // RUN: --offload-arch=gfx908:xnack+:sramecc+ \
11 // RUN: --offload-arch=gfx908:xnack+:sramecc- \
12 // RUN: --rocm-path=%S/Inputs/rocm \
13 // RUN: --no-offload-new-driver -save-temps \
14 // RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK,TMP %s
16 // RUN: %clang -### --target=x86_64-linux-gnu \
18 // RUN: --offload-arch=gfx908:xnack+:sramecc+ \
19 // RUN: --offload-arch=gfx908:xnack+:sramecc- \
20 // RUN: --rocm-path=%S/Inputs/rocm \
21 // RUN: --no-offload-new-driver -fgpu-rdc \
22 // RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK %s
24 // CHECK: [[CLANG:"[^"]*clang[^"]*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
25 // CHECK-SAME: "-target-cpu" "gfx908"
26 // CHECK-SAME: "-target-feature" "+sramecc"
27 // CHECK-SAME: "-target-feature" "+xnack"
29 // TMP: [[CLANG:"[^"]*clang[^"]*"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
30 // TMP-SAME: "-target-cpu" "gfx908"
31 // TMP-SAME: "-target-feature" "+sramecc"
32 // TMP-SAME: "-target-feature" "+xnack"
34 // CHECK: [[LLD:"[^"]*lld[^"]*"]] {{.*}} "-plugin-opt=mcpu=gfx908"
35 // CHECK-SAME: "-plugin-opt=-mattr=+sramecc,+xnack"
37 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
38 // CHECK-SAME: "-target-cpu" "gfx908"
39 // CHECK-SAME: "-target-feature" "-sramecc"
40 // CHECK-SAME: "-target-feature" "+xnack"
42 // CHECK: [[LLD]] {{.*}} "-plugin-opt=mcpu=gfx908"
43 // CHECK-SAME: "-plugin-opt=-mattr=-sramecc,+xnack"
45 // CHECK: {{"[^"]*clang-offload-bundler[^"]*"}}
46 // CHECK-SAME: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+:xnack+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-:xnack+"
48 // Check canonicalization and repeating of target ID.
50 // RUN: %clang -### --target=x86_64-linux-gnu \
52 // RUN: --offload-arch=fiji \
53 // RUN: --offload-arch=gfx803 \
54 // RUN: --offload-arch=fiji \
55 // RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
56 // RUN: %s 2>&1 | FileCheck -check-prefix=FIJI %s
57 // FIJI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803"
59 // RUN: not %clang -### --target=x86_64-linux-gnu \
61 // RUN: --offload-arch=gfx900:xnack- \
62 // RUN: --offload-arch=gfx900:xnack+ \
63 // RUN: --offload-arch=gfx908:sramecc+ \
64 // RUN: --offload-arch=gfx908:sramecc- \
65 // RUN: --offload-arch=gfx906 \
66 // RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
67 // RUN: %s 2>&1 | FileCheck -check-prefix=MULTI %s
68 // MULTI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900:xnack+,hipv4-amdgcn-amd-amdhsa--gfx900:xnack-,hipv4-amdgcn-amd-amdhsa--gfx906,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-"