Mercurial > hg > CbC > CbC_llvm
comparison clang/test/Driver/hip-code-object-version.hip @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | 79ff65ed7e25 |
children | 1f2b6ac9f198 |
comparison
equal
deleted
inserted
replaced
232:70dce7da266c | 236:c4bab56944e8 |
---|---|
1 // REQUIRES: clang-driver, amdgpu-registered-target | 1 // REQUIRES: amdgpu-registered-target |
2 | 2 |
3 // Check bundle ID for code object v2. | 3 // Check bundle ID for code object v2. |
4 | 4 |
5 // RUN: %clang -### -target x86_64-linux-gnu \ | 5 // RUN: %clang -### --target=x86_64-linux-gnu \ |
6 // RUN: -mno-code-object-v3 \ | 6 // RUN: -mno-code-object-v3 \ |
7 // RUN: --offload-arch=gfx906 -nogpulib \ | 7 // RUN: --offload-arch=gfx906 -nogpulib \ |
8 // RUN: %s 2>&1 | FileCheck -check-prefixes=V2,V2-WARN %s | 8 // RUN: %s 2>&1 | FileCheck -check-prefixes=V2,V2-WARN %s |
9 | 9 |
10 // RUN: %clang -### -target x86_64-linux-gnu \ | 10 // RUN: %clang -### --target=x86_64-linux-gnu \ |
11 // RUN: -mcode-object-version=2 \ | 11 // RUN: -mcode-object-version=2 \ |
12 // RUN: --offload-arch=gfx906 -nogpulib \ | 12 // RUN: --offload-arch=gfx906 -nogpulib \ |
13 // RUN: %s 2>&1 | FileCheck -check-prefix=V2 %s | 13 // RUN: %s 2>&1 | FileCheck -check-prefix=V2 %s |
14 | 14 |
15 // V2-WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated] | 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" | 16 // V2: "-mllvm" "--amdhsa-code-object-version=2" |
17 // V2: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906" | 17 // V2: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906" |
18 | 18 |
19 // Check bundle ID for code object v3. | 19 // Check bundle ID for code object v3. |
20 | 20 |
21 // RUN: %clang -### -target x86_64-linux-gnu \ | 21 // RUN: %clang -### --target=x86_64-linux-gnu \ |
22 // RUN: -mcode-object-v3 \ | 22 // RUN: -mcode-object-v3 \ |
23 // RUN: --offload-arch=gfx906 -nogpulib \ | 23 // RUN: --offload-arch=gfx906 -nogpulib \ |
24 // RUN: %s 2>&1 | FileCheck -check-prefixes=V3,V3-WARN %s | 24 // RUN: %s 2>&1 | FileCheck -check-prefixes=V3,V3-WARN %s |
25 | 25 |
26 // RUN: %clang -### -target x86_64-linux-gnu \ | 26 // RUN: %clang -### --target=x86_64-linux-gnu \ |
27 // RUN: -mcode-object-version=3 \ | 27 // RUN: -mcode-object-version=3 \ |
28 // RUN: --offload-arch=gfx906 -nogpulib \ | 28 // RUN: --offload-arch=gfx906 -nogpulib \ |
29 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s | 29 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s |
30 | 30 |
31 // RUN: %clang -### -target x86_64-linux-gnu \ | 31 // RUN: %clang -### --target=x86_64-linux-gnu \ |
32 // RUN: -mcode-object-version=4 -mcode-object-version=3 \ | 32 // RUN: -mcode-object-version=4 -mcode-object-version=3 \ |
33 // RUN: --offload-arch=gfx906 -nogpulib \ | 33 // RUN: --offload-arch=gfx906 -nogpulib \ |
34 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s | 34 // RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s |
35 | 35 |
36 // V3-WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated] | 36 // V3-WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated] |
37 // V3: "-mcode-object-version=3" | |
37 // V3: "-mllvm" "--amdhsa-code-object-version=3" | 38 // V3: "-mllvm" "--amdhsa-code-object-version=3" |
38 // V3: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906" | 39 // V3: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906" |
39 | 40 |
40 // Check bundle ID for code object version 4. | 41 // Check bundle ID for code object version 4. |
41 | 42 |
42 // RUN: %clang -### -target x86_64-linux-gnu \ | 43 // RUN: %clang -### --target=x86_64-linux-gnu \ |
43 // RUN: -mcode-object-version=4 \ | 44 // RUN: -mcode-object-version=4 \ |
44 // RUN: --offload-arch=gfx906 -nogpulib \ | 45 // RUN: --offload-arch=gfx906 -nogpulib \ |
45 // RUN: %s 2>&1 | FileCheck -check-prefix=V4 %s | 46 // RUN: %s 2>&1 | FileCheck -check-prefix=V4 %s |
46 | 47 |
48 // V4: "-mcode-object-version=4" | |
47 // V4: "-mllvm" "--amdhsa-code-object-version=4" | 49 // V4: "-mllvm" "--amdhsa-code-object-version=4" |
48 // V4: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906" | 50 // V4: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906" |
49 | 51 |
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 | |
50 // Check bundle ID for code object version default | 63 // Check bundle ID for code object version default |
51 | 64 |
52 // RUN: %clang -### -target x86_64-linux-gnu \ | 65 // RUN: %clang -### --target=x86_64-linux-gnu \ |
53 // RUN: --offload-arch=gfx906 -nogpulib \ | 66 // RUN: --offload-arch=gfx906 -nogpulib \ |
54 // RUN: %s 2>&1 | FileCheck -check-prefix=VD %s | 67 // RUN: %s 2>&1 | FileCheck -check-prefix=VD %s |
55 | 68 |
56 // VD: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906" | 69 // VD: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906" |
57 | 70 |
58 // Check invalid code object version option. | 71 // Check invalid code object version option. |
59 | 72 |
60 // RUN: %clang -### -target x86_64-linux-gnu \ | 73 // RUN: %clang -### --target=x86_64-linux-gnu \ |
61 // RUN: -mcode-object-version=1 \ | 74 // RUN: -mcode-object-version=1 \ |
62 // RUN: --offload-arch=gfx906 -nogpulib \ | 75 // RUN: --offload-arch=gfx906 -nogpulib \ |
63 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID %s | 76 // RUN: %s 2>&1 | FileCheck -check-prefix=INVALID %s |
64 // INVALID: error: invalid integral value '1' in '-mcode-object-version=1' | 77 // INVALID: error: invalid integral value '1' in '-mcode-object-version=1' |
65 // INVALID-NOT: error: invalid integral value | 78 // INVALID-NOT: error: invalid integral value |
66 | 79 |
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 | |
67 // Check warnings are emitted for legacy options before -mcode-object-version options. | 99 // Check warnings are emitted for legacy options before -mcode-object-version options. |
68 // Check warnings are emitted only once. | 100 // Check warnings are emitted only once. |
69 | 101 |
70 // RUN: %clang -### -target x86_64-linux-gnu \ | 102 // RUN: %clang -### --target=x86_64-linux-gnu \ |
71 // RUN: -mno-code-object-v3 -mcode-object-v3 -mcode-object-version=4 \ | 103 // RUN: -mno-code-object-v3 -mcode-object-v3 -mcode-object-version=4 \ |
72 // RUN: --offload-arch=gfx906 -nogpulib \ | 104 // RUN: --offload-arch=gfx906 -nogpulib \ |
73 // RUN: %s 2>&1 | FileCheck -check-prefixes=WARN %s | 105 // RUN: %s 2>&1 | FileCheck -check-prefixes=WARN %s |
74 // WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated] | 106 // WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated] |
75 // WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated] | 107 // WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated] |