blob: 028a7760d8b98821c532a5e7009cf716cf678c0d [file] [log] [blame]
Alexey Bataev2bf9b4c2015-10-20 04:24:12 +00001// RUN: %clangxx -c -target %itanium_abi_triple -g %s -emit-llvm -S -o - | FileCheck %s
2// RUN: %clangxx -c -target %ms_abi_triple -g %s -emit-llvm -S -o - | FileCheck %s
3
4struct Foo {
5 int A;
6 Foo() : A(1){};
7};
8
9struct Bar {
10 int B;
11 Bar() : B(2){};
12};
13
14struct Baz {
15 int C;
16 Baz() : C(3){};
17};
18
19struct Qux {
20 int d() { return 4; }
21 Qux() {};
22};
23
24struct Quux {
25 int E;
26 Quux() : E(5){};
27};
28
29typedef int(Qux::*TD)();
30typedef int(Qux::*TD1)();
31int Val = reinterpret_cast<Baz *>(0)->C;
32int main() {
33 Bar *PB = new Bar;
34 TD d = &Qux::d;
35 (void)reinterpret_cast<TD1>(d);
36
37 return reinterpret_cast<Foo *>(PB)->A + reinterpret_cast<Quux *>(0)->E;
38}
39
40// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",
41// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Bar",
42// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Baz",
43// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Qux",
44// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Quux",
45// CHECK-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "TD",
46// CHECK-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "TD1",