2018-08-31 13:49:54 +08:00
|
|
|
;RUN: llc < %s -march=amdgcn -mtriple=amdgcn-- -verify-machineinstrs | FileCheck -check-prefixes=CHECK,GCN %s
|
|
|
|
;RUN: llc < %s -march=r600 -mtriple=r600-- -verify-machineinstrs | FileCheck -check-prefixes=CHECK,R600 %s
|
2017-02-07 08:43:21 +08:00
|
|
|
|
2018-02-14 02:00:25 +08:00
|
|
|
%struct.S = type { i32 addrspace(5)*, i32 addrspace(1)*, i32 addrspace(4)*, i32 addrspace(3)*, i32*, i32 addrspace(2)*}
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr_priv:
|
2017-03-14 03:47:31 +08:00
|
|
|
; CHECK-NEXT: .long 0
|
2017-11-28 04:48:21 +08:00
|
|
|
@nullptr_priv = global i32 addrspace(5)* addrspacecast (i32* null to i32 addrspace(5)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr_glob:
|
2017-11-28 04:48:21 +08:00
|
|
|
; GCN-NEXT: .quad 0
|
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr_glob = global i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr_const:
|
2017-11-28 04:48:21 +08:00
|
|
|
; GCN-NEXT: .quad 0
|
|
|
|
; R600-NEXT: .long 0
|
2018-02-14 02:00:25 +08:00
|
|
|
@nullptr_const = global i32 addrspace(4)* addrspacecast (i32* null to i32 addrspace(4)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr_local:
|
|
|
|
; CHECK-NEXT: .long -1
|
2017-11-28 04:48:21 +08:00
|
|
|
@nullptr_local = global i32 addrspace(3)* addrspacecast (i32* null to i32 addrspace(3)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr_region:
|
|
|
|
; CHECK-NEXT: .long -1
|
2018-02-14 02:00:25 +08:00
|
|
|
@nullptr_region = global i32 addrspace(2)* addrspacecast (i32* null to i32 addrspace(2)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr6:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr6 = global i32 addrspace(6)* addrspacecast (i32* null to i32 addrspace(6)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr7:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr7 = global i32 addrspace(7)* addrspacecast (i32* null to i32 addrspace(7)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr8:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr8 = global i32 addrspace(8)* addrspacecast (i32* null to i32 addrspace(8)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr9:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr9 = global i32 addrspace(9)* addrspacecast (i32* null to i32 addrspace(9)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr10:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr10 = global i32 addrspace(10)* addrspacecast (i32* null to i32 addrspace(10)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr11:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr11 = global i32 addrspace(11)* addrspacecast (i32* null to i32 addrspace(11)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr12:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr12 = global i32 addrspace(12)* addrspacecast (i32* null to i32 addrspace(12)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr13:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr13 = global i32 addrspace(13)* addrspacecast (i32* null to i32 addrspace(13)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr14:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr14 = global i32 addrspace(14)* addrspacecast (i32* null to i32 addrspace(14)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr15:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr15 = global i32 addrspace(15)* addrspacecast (i32* null to i32 addrspace(15)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr16:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr16 = global i32 addrspace(16)* addrspacecast (i32* null to i32 addrspace(16)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr17:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr17 = global i32 addrspace(17)* addrspacecast (i32* null to i32 addrspace(17)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr18:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr18 = global i32 addrspace(18)* addrspacecast (i32* null to i32 addrspace(18)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr19:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr19 = global i32 addrspace(19)* addrspacecast (i32* null to i32 addrspace(19)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr20:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr20 = global i32 addrspace(20)* addrspacecast (i32* null to i32 addrspace(20)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr21:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr21 = global i32 addrspace(21)* addrspacecast (i32* null to i32 addrspace(21)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr22:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr22 = global i32 addrspace(22)* addrspacecast (i32* null to i32 addrspace(22)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: nullptr23:
|
2017-11-28 04:48:21 +08:00
|
|
|
; R600-NEXT: .long 0
|
|
|
|
@nullptr23 = global i32 addrspace(23)* addrspacecast (i32* null to i32 addrspace(23)*)
|
2017-02-07 08:43:21 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: structWithPointers:
|
2017-03-14 03:47:31 +08:00
|
|
|
; CHECK-NEXT: .long 0
|
2017-11-28 04:48:21 +08:00
|
|
|
; GCN-NEXT: .zero 4
|
|
|
|
; GCN-NEXT: .quad 0
|
|
|
|
; R600-NEXT: .long 0
|
|
|
|
; GCN-NEXT: .quad 0
|
|
|
|
; R600-NEXT: .long 0
|
2017-02-07 08:43:21 +08:00
|
|
|
; CHECK-NEXT: .long -1
|
2017-11-28 04:48:21 +08:00
|
|
|
; GCN-NEXT: .zero 4
|
|
|
|
; GCN-NEXT: .quad 0
|
|
|
|
; R600-NEXT: .long 0
|
2017-02-07 08:43:21 +08:00
|
|
|
; CHECK-NEXT: .long -1
|
2017-11-28 04:48:21 +08:00
|
|
|
; GCN-NEXT: .zero 4
|
2017-02-07 08:43:21 +08:00
|
|
|
@structWithPointers = addrspace(1) global %struct.S {
|
2017-11-28 04:48:21 +08:00
|
|
|
i32 addrspace(5)* addrspacecast (i32* null to i32 addrspace(5)*),
|
|
|
|
i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*),
|
2018-02-14 02:00:25 +08:00
|
|
|
i32 addrspace(4)* addrspacecast (i32* null to i32 addrspace(4)*),
|
2017-11-28 04:48:21 +08:00
|
|
|
i32 addrspace(3)* addrspacecast (i32* null to i32 addrspace(3)*),
|
|
|
|
i32* null,
|
2018-02-14 02:00:25 +08:00
|
|
|
i32 addrspace(2)* addrspacecast (i32* null to i32 addrspace(2)*)}, align 4
|