blob: 396b7e94a8ea6e72125027c632c7b8c56efefca6 [file] [log] [blame]
Eric Christophercab9fae2014-04-10 05:20:00 +00001// RUN: %clang_cc1 -emit-llvm -gdwarf-4 -triple x86_64-linux-gnu %s -o - | FileCheck %s
2
3// Make sure that we emit a global variable for each of the members of the
4// anonymous union.
5
6static union {
7 int c;
8 int d;
9 union {
10 int a;
11 };
12 struct {
13 int b;
14 };
15};
16
17int test_it() {
18 c = 1;
19 d = 2;
20 a = 4;
21 return (c == 1);
22}
23
24// CHECK: [[FILE:.*]] = {{.*}}[ DW_TAG_file_type ] [{{.*}}debug-info-anon-union-vars.cpp]
25// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [c] [line 6] [local] [def]
26// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [d] [line 6] [local] [def]
27// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [a] [line 6] [local] [def]
28// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [b] [line 6] [local] [def]