summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/debug-info-codeview-heapallocsite.c
blob: a0a7e3b71c3837a1aa7dfe7b06b7526a3a72e321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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"

OpenPOWER on IntegriCloud