2022-04-07 18:03:55 +08:00
|
|
|
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -fdeclspec -S -emit-llvm %s -o - | FileCheck %s
|
2019-04-13 04:25:30 +08:00
|
|
|
|
2019-05-03 04:07:35 +08:00
|
|
|
struct Foo;
|
|
|
|
struct Bar;
|
2019-04-13 04:25:30 +08:00
|
|
|
|
2022-02-15 22:27:12 +08:00
|
|
|
__declspec(allocator) void *alloc_void(void);
|
|
|
|
__declspec(allocator) struct Foo *alloc_foo(void);
|
2019-04-13 04:25:30 +08:00
|
|
|
|
2022-02-15 22:27:12 +08:00
|
|
|
void call_alloc(void) {
|
2019-05-03 04:07:35 +08:00
|
|
|
struct Foo *p = alloc_void();
|
2020-06-09 10:07:59 +08:00
|
|
|
struct Foo *w = alloc_foo();
|
2019-05-03 04:07:35 +08:00
|
|
|
struct Foo *q = (struct Foo*)alloc_void();
|
|
|
|
struct Foo *r = (struct Foo*)(struct Bar*)alloc_void();
|
2019-04-13 04:25:30 +08:00
|
|
|
}
|
|
|
|
|
2019-05-03 04:07:35 +08:00
|
|
|
// CHECK-LABEL: define {{.*}}void @call_alloc
|
2019-04-13 04:25:30 +08:00
|
|
|
// CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG1:!.*]]
|
2020-06-09 10:07:59 +08:00
|
|
|
// CHECK: call %struct.Foo* {{.*}}@alloc_foo{{.*}} !heapallocsite [[DBG2:!.*]]
|
|
|
|
// CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG2]]
|
2019-05-03 04:07:35 +08:00
|
|
|
// CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG3:!.*]]
|
2019-04-13 04:25:30 +08:00
|
|
|
|
2019-05-03 04:07:35 +08:00
|
|
|
// CHECK: [[DBG2]] = !DICompositeType(tag: DW_TAG_structure_type,
|
2019-04-13 04:25:30 +08:00
|
|
|
// CHECK-SAME: name: "Foo"
|
2019-05-03 04:07:35 +08:00
|
|
|
// CHECK: [[DBG3]] = !DICompositeType(tag: DW_TAG_structure_type,
|
|
|
|
// CHECK-SAME: name: "Bar"
|
2021-08-31 03:32:57 +08:00
|
|
|
// CHECK: [[DBG1]] = !{}
|