2013-03-20 13:12:06 +08:00
|
|
|
// RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s
|
2010-10-28 07:23:58 +08:00
|
|
|
|
|
|
|
namespace A {
|
2013-03-21 03:10:57 +08:00
|
|
|
#line 1 "foo.cpp"
|
|
|
|
namespace B {
|
2013-03-20 13:12:06 +08:00
|
|
|
int i;
|
2010-10-28 07:23:58 +08:00
|
|
|
}
|
2013-04-26 13:41:06 +08:00
|
|
|
using namespace B;
|
2013-03-21 03:10:57 +08:00
|
|
|
}
|
2010-10-28 07:23:58 +08:00
|
|
|
|
2013-04-26 13:41:06 +08:00
|
|
|
using namespace A;
|
|
|
|
|
2013-04-22 14:13:21 +08:00
|
|
|
int func() {
|
|
|
|
using namespace A::B;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2013-04-26 13:41:06 +08:00
|
|
|
// CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
|
2013-03-21 07:57:15 +08:00
|
|
|
// CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp"
|
2013-04-26 13:41:06 +08:00
|
|
|
// CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 9] [def] [func]
|
2013-04-22 14:13:21 +08:00
|
|
|
// CHECK: [[FILE2:![0-9]*]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
|
2013-03-20 13:12:06 +08:00
|
|
|
// CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i]
|
2013-04-22 14:13:21 +08:00
|
|
|
// CHECK: [[NS]] = {{.*}}, metadata [[FILE2]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
|
2013-03-28 10:44:15 +08:00
|
|
|
// CHECK: [[CTXT]] = {{.*}}, metadata [[FILE]], null, {{.*}} ; [ DW_TAG_namespace ] [A] [line 3]
|
2013-04-26 13:41:06 +08:00
|
|
|
// CHECK: [[MODULES]] = metadata !{metadata [[M1:![0-9]*]], metadata [[M2:![0-9]*]], metadata [[M3:![0-9]*]]}
|
|
|
|
// CHECK: [[M1]] = metadata !{i32 {{[0-9]*}}, metadata [[CTXT]], metadata [[NS]], i32 4} ; [ DW_TAG_imported_module ]
|
|
|
|
// CHECK: [[M2]] = metadata !{i32 {{[0-9]*}}, metadata [[CU]], metadata [[CTXT]], i32 7} ; [ DW_TAG_imported_module ]
|
|
|
|
// CHECK: [[M3]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[NS]], i32 10} ; [ DW_TAG_imported_module ]
|
2013-03-27 02:57:40 +08:00
|
|
|
|
|
|
|
// FIXME: It is confused on win32 to generate file entry when dosish filename is given.
|
|
|
|
// REQUIRES: shell
|