File: invalid-addrspacecast.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (37 lines) | stat: -rw-r--r-- 1,985 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; RUN: not llc -global-isel=0 -march=amdgcn -mcpu=bonaire -mattr=-promote-alloca < %s 2>&1 | FileCheck -check-prefix=ERROR %s
; RUN: not llc -global-isel=1 -march=amdgcn -mcpu=bonaire -mattr=-promote-alloca < %s 2>&1 | FileCheck -check-prefix=ERROR %s

; ERROR: error: <unknown>:0:0: in function use_group_to_global_addrspacecast void (ptr addrspace(3)): invalid addrspacecast
define amdgpu_kernel void @use_group_to_global_addrspacecast(ptr addrspace(3) %ptr) {
  %stof = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(1)
  store volatile i32 0, ptr addrspace(1) %stof
  ret void
}

; ERROR: error: <unknown>:0:0: in function use_local_to_constant32bit_addrspacecast void (ptr addrspace(3)): invalid addrspacecast
define amdgpu_kernel void @use_local_to_constant32bit_addrspacecast(ptr addrspace(3) %ptr) {
  %stof = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(6)
  %load = load volatile i32, ptr addrspace(6) %stof
  ret void
}

; ERROR: error: <unknown>:0:0: in function use_constant32bit_to_local_addrspacecast void (ptr addrspace(6)): invalid addrspacecast
define amdgpu_kernel void @use_constant32bit_to_local_addrspacecast(ptr addrspace(6) %ptr) {
  %cast = addrspacecast ptr addrspace(6) %ptr to ptr addrspace(3)
  %load = load volatile i32, ptr addrspace(3) %cast
  ret void
}

; ERROR: error: <unknown>:0:0: in function use_local_to_42_addrspacecast void (ptr addrspace(3)): invalid addrspacecast
define amdgpu_kernel void @use_local_to_42_addrspacecast(ptr addrspace(3) %ptr) {
  %cast = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(42)
  store volatile ptr addrspace(42) %cast, ptr addrspace(1) null
  ret void
}

; ERROR: error: <unknown>:0:0: in function use_42_to_local_addrspacecast void (ptr addrspace(42)): invalid addrspacecast
define amdgpu_kernel void @use_42_to_local_addrspacecast(ptr addrspace(42) %ptr) {
  %cast = addrspacecast ptr addrspace(42) %ptr to ptr addrspace(3)
  %load = load volatile i32, ptr addrspace(3) %cast
  ret void
}