@@ -24,30 +24,33 @@ export void foo() {
2424// CHECK: %"class.hlsl::RasterizerOrderedByteAddressBuffer" = type { target("dx.RawBuffer", i8, 1, 1) }
2525
2626// CHECK: @_ZL4Buf1 = internal global %"class.hlsl::ByteAddressBuffer" poison, align 4
27+ // CHECK: @[[Buf1Str:.*]] = private unnamed_addr constant [5 x i8] c"Buf1\00", align 1
2728// CHECK: @_ZL4Buf2 = internal global %"class.hlsl::RWByteAddressBuffer" poison, align 4
29+ // CHECK: @[[Buf2Str:.*]] = private unnamed_addr constant [5 x i8] c"Buf2\00", align 1
2830
2931// Buf1 initialization part 1 - global init function that calls ByteAddressBuffer C1 constructor with explicit binding
3032// CHECK: define internal void @__cxx_global_var_init()
3133// CHECK-NEXT: entry:
32- // CHECK-NEXT: call void @_ZN4hlsl17ByteAddressBufferC1Ejjij (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf1,
33- // CHECK-SAME: i32 noundef 1, i32 noundef 2, i32 noundef 1, i32 noundef 0)
34+ // CHECK-NEXT: call void @_ZN4hlsl17ByteAddressBufferC1EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf1,
35+ // CHECK-SAME: i32 noundef 1, i32 noundef 2, i32 noundef 1, i32 noundef 0, ptr noundef @[[Buf1Str]] )
3436
3537// Buf1 initialization part 2 - body of ByteAddressBuffer C1 constructor with explicit binding that calls the C2 constructor
36- // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC1Ejjij (ptr noundef nonnull align 4 dereferenceable(4) %this,
37- // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
38- // CHECK: call void @_ZN4hlsl17ByteAddressBufferC2Ejjij (ptr noundef nonnull align 4 dereferenceable(4)
39- // CHECK-SAME: %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}})
38+ // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC1EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) %this,
39+ // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, ptr noundef %name )
40+ // CHECK: call void @_ZN4hlsl17ByteAddressBufferC2EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4)
41+ // CHECK-SAME: %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, ptr noundef %{{.*}} )
4042
4143// Buf2 initialization part 1 - global init function that calls RWByteAddressBuffer C1 constructor with implicit binding
42- // CHECK: define internal void @__cxx_global_var_init.1() #0 {
44+ // CHECK: define internal void @__cxx_global_var_init.1()
4345// CHECK-NEXT: entry:
44- // CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1Ejijj (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2,
45- // CHECK-SAME: i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0)
46+ // CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1EjijjPKc (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2,
47+ // CHECK-SAME: i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0, ptr noundef @[[Buf2Str]] )
4648
4749// Buf2 initialization part 2 - body of RWByteAddressBuffer C1 constructor with implicit binding that calls the C2 constructor
48- // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC1Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this,
49- // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId)
50- // CHECK: call void @_ZN4hlsl19RWByteAddressBufferC2Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this1, i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4
50+ // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC1EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this,
51+ // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId, ptr noundef %name)
52+ // CHECK: call void @_ZN4hlsl19RWByteAddressBufferC2EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this1,
53+ // CHECK-SAME: i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, ptr noundef %{{.*}})
5154
5255// Buf3 initialization part 1 - local variable declared in function foo() is initialized by
5356// RasterizerOrderedByteAddressBuffer C1 default constructor
@@ -64,18 +67,19 @@ export void foo() {
6467
6568// Buf1 initialization part 3 - ByteAddressBuffer C2 constructor with explicit binding that initializes
6669// handle with @llvm.dx.resource.handlefrombinding
67- // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC2Ejjij (ptr noundef nonnull align 4 dereferenceable(4) %this,
68- // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
70+ // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC2EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) %this,
71+ // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, ptr noundef %name )
6972// CHECK-DXIL: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_i8_0_0t(
7073// CHECK-DXIL-SAME: i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
7174// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::ByteAddressBuffer", ptr %{{.*}}, i32 0, i32 0
7275// CHECK-DXIL-NEXT: store target("dx.RawBuffer", i8, 0, 0) %[[HANDLE]], ptr %__handle, align 4
7376
7477// Buf2 initialization part 3 - body of RWByteAddressBuffer C2 constructor with implicit binding that initializes
7578// handle with @llvm.dx.resource.handlefromimplicitbinding
76- // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC2Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this,
77- // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId) unnamed_addr #1 align 2 {
78- // CHECK: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_i8_1_0t(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
79+ // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC2EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this,
80+ // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId, ptr noundef %name)
81+ // CHECK: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_i8_1_0t
82+ // CHECK-SAME: (i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
7983// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::RWByteAddressBuffer", ptr %this1, i32 0, i32 0
8084// CHECK-NEXT: store target("dx.RawBuffer", i8, 1, 0) %[[HANDLE]], ptr %__handle, align 4
8185
0 commit comments