1 ; RUN: llc --filetype=obj %s -o - | dxil-dis -o - | FileCheck %s
2 target triple = "dxil-unknown-shadermodel6.7-library"
4 define i64 @test(ptr %p) {
10 ; CHECK: define i64 @test(i8* %p) {
11 ; CHECK-NEXT: %1 = bitcast i8* %p to i32*
12 ; CHECK-NEXT: store i32 0, i32* %1, align 4
13 ; CHECK-NEXT: %2 = bitcast i8* %p to i64*
14 ; CHECK-NEXT: %3 = load i64, i64* %2, align 8
16 define i64 @test2(ptr %p) {
22 ; CHECK: define i64 @test2(i64* %p) {
23 ; CHECK-NEXT: store i64 0, i64* %p, align 8
24 ; CHECK-NEXT: %v = load i64, i64* %p, align 8
26 define i64 @test3(ptr addrspace(1) %p) {
27 store i32 0, ptr addrspace(1) %p
28 %v = load i64, ptr addrspace(1) %p
32 ; CHECK: define i64 @test3(i8 addrspace(1)* %p) {
33 ; CHECK-NEXT: %1 = bitcast i8 addrspace(1)* %p to i32 addrspace(1)*
34 ; CHECK-NEXT: store i32 0, i32 addrspace(1)* %1, align 4
35 ; CHECK-NEXT: %2 = bitcast i8 addrspace(1)* %p to i64 addrspace(1)*
36 ; CHECK-NEXT: %3 = load i64, i64 addrspace(1)* %2, align 8
38 define i64 @test4(ptr addrspace(1) %p) {
39 store i64 0, ptr addrspace(1) %p
40 %v = load i64, ptr addrspace(1) %p
44 ; CHECK: define i64 @test4(i64 addrspace(1)* %p) {
45 ; CHECK-NEXT: store i64 0, i64 addrspace(1)* %p, align 8
46 ; CHECK-NEXT: %v = load i64, i64 addrspace(1)* %p, align 8
49 define i64 @test5(ptr %p) {
50 %casted = addrspacecast ptr %p to ptr addrspace(1)
51 store i64 0, ptr addrspace(1) %casted
52 %v = load i64, ptr addrspace(1) %casted
56 ; CHECK: define i64 @test5(i8* %p) {
57 ; CHECK-NEXT: %casted = addrspacecast i8* %p to i64 addrspace(1)*
58 ; CHECK-NEXT: store i64 0, i64 addrspace(1)* %casted, align 8
59 ; CHECK-NEXT: %v = load i64, i64 addrspace(1)* %casted, align 8