1 // RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -fdeclspec -S -emit-llvm %s -o - | FileCheck %s
2
3 struct Foo;
4 struct Bar;
5
6 __declspec(allocator) void *alloc_void();
7 __declspec(allocator) struct Foo *alloc_foo();
8
call_alloc()9 void call_alloc() {
10 struct Foo *p = alloc_void();
11 struct Foo *w = alloc_foo();
12 struct Foo *q = (struct Foo*)alloc_void();
13 struct Foo *r = (struct Foo*)(struct Bar*)alloc_void();
14 }
15
16 // CHECK-LABEL: define {{.*}}void @call_alloc
17 // CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG1:!.*]]
18 // CHECK: call %struct.Foo* {{.*}}@alloc_foo{{.*}} !heapallocsite [[DBG2:!.*]]
19 // CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG2]]
20 // CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG3:!.*]]
21
22 // CHECK: [[DBG1]] = !{}
23 // CHECK: [[DBG2]] = !DICompositeType(tag: DW_TAG_structure_type,
24 // CHECK-SAME: name: "Foo"
25 // CHECK: [[DBG3]] = !DICompositeType(tag: DW_TAG_structure_type,
26 // CHECK-SAME: name: "Bar"
27