mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 20:46:06 +00:00

With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-linux-gnu %s -o - | FileCheck %s
|
|
|
|
// Make sure that we emit a global variable for each of the members of the
|
|
// anonymous union.
|
|
|
|
static union {
|
|
int c;
|
|
int d;
|
|
union {
|
|
int a;
|
|
};
|
|
struct {
|
|
int b;
|
|
};
|
|
};
|
|
|
|
int test_it() {
|
|
c = 1;
|
|
d = 2;
|
|
a = 4;
|
|
return (c == 1);
|
|
}
|
|
|
|
void foo() {
|
|
union {
|
|
int i;
|
|
char c;
|
|
};
|
|
i = 8;
|
|
}
|
|
|
|
// CHECK: [[FILE:.*]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",
|
|
// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
|
|
// CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
|
|
// CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
|
|
// CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
|
|
// CHECK: !DILocalVariable(name: "i", {{.*}}, flags: DIFlagArtificial
|
|
// CHECK: !DILocalVariable(name: "c", {{.*}}, flags: DIFlagArtificial
|
|
// CHECK: !DILocalVariable(
|
|
// CHECK-NOT: name:
|
|
// CHECK: type: ![[UNION:[0-9]+]]
|
|
// CHECK: ![[UNION]] = !DICompositeType(tag: DW_TAG_union_type,
|
|
// CHECK-NOT: name:
|
|
// CHECK: elements
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i", scope: ![[UNION]],
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c", scope: ![[UNION]],
|