Debian Codegraph @

clang/test/Driver/hip-code-object-version.hip

raw
1 // Check bundle ID for code object version 4.
2
3 // RUN: not %clang -### --target=x86_64-linux-gnu \
4 // RUN: -mcode-object-version=4 \
5 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
6 // RUN: %s 2>&1 | FileCheck -check-prefix=V4 %s
7
8 // V4: "-mcode-object-version=4"
9 // V4: "-mllvm" "--amdhsa-code-object-version=4"
10 // V4: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
11
12 // Check bundle ID for code object version 5.
13
14 // RUN: not %clang -### --target=x86_64-linux-gnu \
15 // RUN: -mcode-object-version=5 \
16 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
17 // RUN: %s 2>&1 | FileCheck -check-prefix=V5 %s
18
19 // V5: "-mcode-object-version=5"
20 // V5: "-mllvm" "--amdhsa-code-object-version=5"
21 // V5: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
22
23 // Check bundle ID for code object version 6.
24
25 // RUN: not %clang -### --target=x86_64-linux-gnu \
26 // RUN: -mcode-object-version=6 \
27 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
28 // RUN: %s 2>&1 | FileCheck -check-prefix=V6 %s
29
30 // V6: "-mcode-object-version=6"
31 // V6: "-mllvm" "--amdhsa-code-object-version=6"
32 // V6: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
33
34 // Check bundle ID for code object version default
35
36 // RUN: %clang -### --target=x86_64-linux-gnu \
37 // RUN: --offload-arch=gfx906 -nogpuinc -nogpulib \
38 // RUN: %s 2>&1 | FileCheck -check-prefix=VD %s
39
40 // VD: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
41
42 // Check invalid code object version option.
43
44 // RUN: not %clang -### --target=x86_64-linux-gnu \
45 // RUN: -mcode-object-version=1 \
46 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
47 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID_1 %s
48 // INVALID_1: error: invalid integral value '1' in '-mcode-object-version=1'
49 // INVALID_1-NOT: error: invalid integral value
50
51 // RUN: not %clang -### --target=x86_64-linux-gnu \
52 // RUN: -mcode-object-version=2 \
53 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
54 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID_2 %s
55 // INVALID_2: error: invalid integral value '2' in '-mcode-object-version=2'
56 // INVALID_2-NOT: error: invalid integral value
57
58 // RUN: not %clang -### --target=x86_64-linux-gnu \
59 // RUN: -mcode-object-version=3 \
60 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
61 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID_3 %s
62 // INVALID_3: error: invalid integral value '3' in '-mcode-object-version=3'
63 // INVALID_3-NOT: error: invalid integral value
64
65 // Check LLVM code object version option --amdhsa-code-object-version
66 // is passed to -cc1 and -cc1as, and -mcode-object-version is passed
67 // to -cc1 but not -cc1as.
68
69 // RUN: not %clang -### --target=x86_64-linux-gnu \
70 // RUN: -mcode-object-version=5 \
71 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm -save-temps \
72 // RUN: %s 2>&1 | FileCheck -check-prefix=CC1 %s
73
74 // CC1: "-cc1" {{.*}}"-mcode-object-version=5" {{.*}}"-mllvm" "--amdhsa-code-object-version=5"
75 // CC1: "-cc1as" {{.*}}"-mllvm" "--amdhsa-code-object-version=5"
76
77 // RUN: not %clang -### --target=x86_64-linux-gnu \
78 // RUN: -mcode-object-version=5 \
79 // RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm -save-temps \
80 // RUN: %s 2>&1 | FileCheck -check-prefix=CC1NEG %s
81
82 // CC1NEG-NOT: "-cc1as" {{.*}}"-mcode-object-version=5"