1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 2; RUN: opt -S -dxil-prepare < %s | FileCheck %s 3target triple = "dxil-unknown-shadermodel6.0-compute" 4 5@gs = external addrspace(3) global [20 x [6 x float]], align 4 6 7; Make sure not crash when has typed ptr. 8define i64 @test(i64* %p) { 9; CHECK-LABEL: define i64 @test( 10; CHECK-SAME: ptr [[P:%.*]]) { 11; CHECK-NEXT: [[V:%.*]] = load i64, ptr [[P]], align 8 12; CHECK-NEXT: ret i64 [[V]] 13; 14 %v = load i64, i64* %p 15 ret i64 %v 16} 17 18; Make sure no bitcast generated. 19define void @test_gep() { 20; CHECK-LABEL: define void @test_gep() { 21; CHECK-NEXT: [[BASE:%.*]] = getelementptr inbounds [20 x [6 x float]], ptr addrspace(3) @gs, i64 0, i64 3 22; CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds [6 x float], ptr addrspace(3) [[BASE]], i64 0, i64 2 23; CHECK-NEXT: store float 1.000000e+00, ptr addrspace(3) [[ADDR]], align 4 24; CHECK-NEXT: ret void 25; 26 %base = getelementptr inbounds [20 x [6 x float]], ptr addrspace(3) @gs, i64 0, i64 3 27 %addr = getelementptr inbounds [6 x float], ptr addrspace(3) %base, i64 0, i64 2 28 store float 1.000000e+00, ptr addrspace(3) %addr, align 4 29 ret void 30} 31