1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-linux-gnu %s -o - | FileCheck %s
3 // Make sure that we emit a global variable for each of the members of the
32 // A funky reinterpret cast idiom that we used to crash on.
34 unsigned char *buildBytes(const T v
) {
36 unsigned char result
[sizeof(T
)];
43 void instantiate(int x
) {
47 // CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE:.*]], line: 6,{{.*}} isLocal: true, isDefinition: true
48 // CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
49 // CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",
50 // CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
51 // CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
52 // CHECK: !DIGlobalVariable(name: "result", {{.*}} isLocal: false, isDefinition: true
53 // CHECK: !DIGlobalVariable(name: "value", {{.*}} isLocal: false, isDefinition: true
54 // CHECK: !DILocalVariable(name: "i", {{.*}}, flags: DIFlagArtificial
55 // CHECK: !DILocalVariable(name: "c", {{.*}}, flags: DIFlagArtificial
56 // CHECK: !DILocalVariable(
58 // CHECK: type: ![[UNION:[0-9]+]]
59 // CHECK: ![[UNION]] = distinct !DICompositeType(tag: DW_TAG_union_type,
62 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i", scope: ![[UNION]],
63 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c", scope: ![[UNION]],