Files
clang-p2996/clang/test/CodeGen/debug-info-codeview-heapallocsite.c
Amy Huang 0d0334fe1b Relanding r357928 with fixed debuginfo check.
[MS] Add metadata for __declspec(allocator)

Original summary:
Emit !heapallocsite in the metadata for calls to functions marked with
__declspec(allocator). Eventually this will be emitted as S_HEAPALLOCSITE debug
info in codeview.

Differential Revision: https://reviews.llvm.org/D60237

llvm-svn: 358307
2019-04-12 20:25:30 +00:00

28 lines
789 B
C

// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -fdeclspec -S -emit-llvm < %s | FileCheck %s
struct Foo {
int x;
};
__declspec(allocator) void *alloc_void();
__declspec(allocator) struct Foo *alloc_foo();
void call_alloc_void() {
struct Foo *p = (struct Foo*)alloc_void();
}
void call_alloc_foo() {
struct Foo *p = alloc_foo();
}
// CHECK-LABEL: define {{.*}}void @call_alloc_void
// CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG1:!.*]]
// CHECK-LABEL: define {{.*}}void @call_alloc_foo
// CHECK: call %struct.Foo* {{.*}}@alloc_foo{{.*}} !heapallocsite [[DBG2:!.*]]
// CHECK: [[DBG1]] = !{}
// CHECK: [[DBG2]] = distinct !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-SAME: name: "Foo"