[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / hip-target-id.hip
blob3ad70b0646a18cd64e910864dc870eda35053edb
1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // RUN: %clang -### --target=x86_64-linux-gnu \
5 // RUN:   -x hip \
6 // RUN:   --offload-arch=gfx908:xnack+:sramecc+ \
7 // RUN:   --offload-arch=gfx908:xnack+:sramecc- \
8 // RUN:   --rocm-path=%S/Inputs/rocm \
9 // RUN:   %s 2>&1 | FileCheck %s
11 // RUN: %clang -### --target=x86_64-linux-gnu \
12 // RUN:   -x hip \
13 // RUN:   --offload-arch=gfx908:xnack+:sramecc+ \
14 // RUN:   --offload-arch=gfx908:xnack+:sramecc- \
15 // RUN:   --rocm-path=%S/Inputs/rocm \
16 // RUN:   -save-temps \
17 // RUN:   %s 2>&1 | FileCheck --check-prefixes=CHECK,TMP %s
19 // RUN: %clang -### --target=x86_64-linux-gnu \
20 // RUN:   -x hip \
21 // RUN:   --offload-arch=gfx908:xnack+:sramecc+ \
22 // RUN:   --offload-arch=gfx908:xnack+:sramecc- \
23 // RUN:   --rocm-path=%S/Inputs/rocm \
24 // RUN:   -fgpu-rdc \
25 // RUN:   %s 2>&1 | FileCheck --check-prefixes=CHECK %s
27 // CHECK: [[CLANG:"[^"]*clang[^"]*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
28 // CHECK-SAME: "-target-cpu" "gfx908"
29 // CHECK-SAME: "-target-feature" "+sramecc"
30 // CHECK-SAME: "-target-feature" "+xnack"
32 // TMP: [[CLANG:"[^"]*clang[^"]*"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
33 // TMP-SAME: "-target-cpu" "gfx908"
34 // TMP-SAME: "-target-feature" "+sramecc"
35 // TMP-SAME: "-target-feature" "+xnack"
37 // CHECK: [[LLD:"[^"]*lld[^"]*"]] {{.*}} "-plugin-opt=mcpu=gfx908"
38 // CHECK-SAME: "-plugin-opt=-mattr=+sramecc,+xnack"
40 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
41 // CHECK-SAME: "-target-cpu" "gfx908"
42 // CHECK-SAME: "-target-feature" "-sramecc"
43 // CHECK-SAME: "-target-feature" "+xnack"
45 // CHECK: [[LLD]] {{.*}} "-plugin-opt=mcpu=gfx908"
46 // CHECK-SAME: "-plugin-opt=-mattr=-sramecc,+xnack"
48 // CHECK: {{"[^"]*clang-offload-bundler[^"]*"}}
49 // CHECK-SAME: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+:xnack+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-:xnack+"
51 // Check canonicalization and repeating of target ID.
53 // RUN: %clang -### --target=x86_64-linux-gnu \
54 // RUN:   -x hip \
55 // RUN:   --offload-arch=fiji \
56 // RUN:   --offload-arch=gfx803 \
57 // RUN:   --offload-arch=fiji \
58 // RUN:   --rocm-path=%S/Inputs/rocm \
59 // RUN:   %s 2>&1 | FileCheck -check-prefix=FIJI %s
60 // FIJI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803"
62 // RUN: %clang -### --target=x86_64-linux-gnu \
63 // RUN:   -x hip \
64 // RUN:   --offload-arch=gfx900:xnack- \
65 // RUN:   --offload-arch=gfx900:xnack+ \
66 // RUN:   --offload-arch=gfx908:sramecc+ \
67 // RUN:   --offload-arch=gfx908:sramecc- \
68 // RUN:   --offload-arch=gfx906 \
69 // RUN:   --rocm-path=%S/Inputs/rocm \
70 // RUN:   %s 2>&1 | FileCheck -check-prefix=MULTI %s
71 // 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-"