236
|
1 // REQUIRES: amdgpu-registered-target
|
221
|
2
|
|
3 // Check bundle ID for code object v2.
|
|
4
|
236
|
5 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
6 // RUN: -mno-code-object-v3 \
|
|
7 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
8 // RUN: %s 2>&1 | FileCheck -check-prefixes=V2,V2-WARN %s
|
|
9
|
236
|
10 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
11 // RUN: -mcode-object-version=2 \
|
|
12 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
13 // RUN: %s 2>&1 | FileCheck -check-prefix=V2 %s
|
|
14
|
|
15 // V2-WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
|
|
16 // V2: "-mllvm" "--amdhsa-code-object-version=2"
|
|
17 // V2: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906"
|
|
18
|
|
19 // Check bundle ID for code object v3.
|
|
20
|
236
|
21 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
22 // RUN: -mcode-object-v3 \
|
|
23 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
24 // RUN: %s 2>&1 | FileCheck -check-prefixes=V3,V3-WARN %s
|
|
25
|
236
|
26 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
27 // RUN: -mcode-object-version=3 \
|
|
28 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
29 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s
|
|
30
|
236
|
31 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
32 // RUN: -mcode-object-version=4 -mcode-object-version=3 \
|
|
33 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
34 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s
|
|
35
|
|
36 // V3-WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
|
236
|
37 // V3: "-mcode-object-version=3"
|
221
|
38 // V3: "-mllvm" "--amdhsa-code-object-version=3"
|
|
39 // V3: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906"
|
|
40
|
|
41 // Check bundle ID for code object version 4.
|
|
42
|
236
|
43 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
44 // RUN: -mcode-object-version=4 \
|
|
45 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
46 // RUN: %s 2>&1 | FileCheck -check-prefix=V4 %s
|
|
47
|
236
|
48 // V4: "-mcode-object-version=4"
|
221
|
49 // V4: "-mllvm" "--amdhsa-code-object-version=4"
|
|
50 // V4: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
|
|
51
|
236
|
52 // Check bundle ID for code object version 5.
|
|
53
|
|
54 // RUN: %clang -### --target=x86_64-linux-gnu \
|
|
55 // RUN: -mcode-object-version=5 \
|
|
56 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
57 // RUN: %s 2>&1 | FileCheck -check-prefix=V5 %s
|
|
58
|
|
59 // V5: "-mcode-object-version=5"
|
|
60 // V5: "-mllvm" "--amdhsa-code-object-version=5"
|
|
61 // V5: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
|
|
62
|
221
|
63 // Check bundle ID for code object version default
|
|
64
|
236
|
65 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
66 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
67 // RUN: %s 2>&1 | FileCheck -check-prefix=VD %s
|
|
68
|
|
69 // VD: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
|
|
70
|
|
71 // Check invalid code object version option.
|
|
72
|
236
|
73 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
74 // RUN: -mcode-object-version=1 \
|
|
75 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
76 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID %s
|
|
77 // INVALID: error: invalid integral value '1' in '-mcode-object-version=1'
|
|
78 // INVALID-NOT: error: invalid integral value
|
|
79
|
236
|
80 // Check LLVM code object version option --amdhsa-code-object-version
|
|
81 // is passed to -cc1 and -cc1as, and -mcode-object-version is passed
|
|
82 // to -cc1 but not -cc1as.
|
|
83
|
|
84 // RUN: %clang -### --target=x86_64-linux-gnu \
|
|
85 // RUN: -mcode-object-version=5 \
|
|
86 // RUN: --offload-arch=gfx906 -nogpulib -save-temps \
|
|
87 // RUN: %s 2>&1 | FileCheck -check-prefix=CC1 %s
|
|
88
|
|
89 // CC1: "-cc1" {{.*}}"-mcode-object-version=5" {{.*}}"-mllvm" "--amdhsa-code-object-version=5"
|
|
90 // CC1: "-cc1as" {{.*}}"-mllvm" "--amdhsa-code-object-version=5"
|
|
91
|
|
92 // RUN: %clang -### --target=x86_64-linux-gnu \
|
|
93 // RUN: -mcode-object-version=5 \
|
|
94 // RUN: --offload-arch=gfx906 -nogpulib -save-temps \
|
|
95 // RUN: %s 2>&1 | FileCheck -check-prefix=CC1NEG %s
|
|
96
|
|
97 // CC1NEG-NOT: "-cc1as" {{.*}}"-mcode-object-version=5"
|
|
98
|
221
|
99 // Check warnings are emitted for legacy options before -mcode-object-version options.
|
|
100 // Check warnings are emitted only once.
|
|
101
|
236
|
102 // RUN: %clang -### --target=x86_64-linux-gnu \
|
221
|
103 // RUN: -mno-code-object-v3 -mcode-object-v3 -mcode-object-version=4 \
|
|
104 // RUN: --offload-arch=gfx906 -nogpulib \
|
|
105 // RUN: %s 2>&1 | FileCheck -check-prefixes=WARN %s
|
|
106 // WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
|
|
107 // WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
|
|
108 // WARN-NOT: warning: argument {{.*}} is deprecated
|