Jyotsna Verma | f0ca9a8 | 2013-04-10 19:53:26 +0000 | [diff] [blame^] | 1 | ; REQUIRES: object-emission |
| 2 | |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 3 | ; RUN: llc -O0 -filetype=obj < %s > %t |
David Blaikie | 6115ed0 | 2013-03-20 19:39:15 +0000 | [diff] [blame] | 4 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 5 | ; CHECK: debug_info contents |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 6 | ; CHECK: DW_TAG_namespace |
David Blaikie | 4cf132f | 2013-03-20 06:27:06 +0000 | [diff] [blame] | 7 | ; CHECK-NEXT: DW_AT_name{{.*}} = "A" |
David Blaikie | 6115ed0 | 2013-03-20 19:39:15 +0000 | [diff] [blame] | 8 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F1:[0-9]]]) |
| 9 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(0x03) |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 10 | ; CHECK-NOT: NULL |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 11 | ; CHECK: DW_TAG_namespace |
| 12 | ; CHECK-NEXT: DW_AT_name{{.*}} = "B" |
David Blaikie | 6115ed0 | 2013-03-20 19:39:15 +0000 | [diff] [blame] | 13 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2:[0-9]]]) |
| 14 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(0x01) |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 15 | ; CHECK-NOT: NULL |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 16 | ; CHECK: DW_TAG_variable |
| 17 | ; CHECK-NEXT: DW_AT_name{{.*}}= "i" |
David Blaikie | 6115ed0 | 2013-03-20 19:39:15 +0000 | [diff] [blame] | 18 | ; CHECK: file_names[ [[F1]]]{{.*}}debug-info-namespace.cpp |
| 19 | ; CHECK: file_names[ [[F2]]]{{.*}}foo.cpp |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 20 | |
| 21 | ; IR generated from clang/test/CodeGenCXX/debug-info-namespace.cpp, file paths |
| 22 | ; changed to protect the guilty. The C++ source code is simply: |
| 23 | ; namespace A { |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 24 | ; #line 1 "foo.cpp" |
| 25 | ; namespace B { |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 26 | ; int i; |
| 27 | ; } |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 28 | ; } |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 29 | |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 30 | @_ZN1A1B1iE = global i32 0, align 4 |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 31 | |
| 32 | !llvm.dbg.cu = !{!0} |
| 33 | |
David Blaikie | 72dfb05 | 2013-03-28 02:44:59 +0000 | [diff] [blame] | 34 | !0 = metadata !{i32 786449, metadata !2, i32 4, metadata !"clang version 3.3 ", i1 false, metadata !"", i32 0, metadata !3, metadata !3, metadata !3, metadata !4, metadata !""} ; [ DW_TAG_compile_unit ] [/home/foo/debug-info-namespace.cpp] [DW_LANG_C_plus_plus] |
| 35 | !1 = metadata !{i32 786473, metadata !2} ; [ DW_TAG_file_type ] [/home/foo/debug-info-namespace.cpp] |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 36 | !2 = metadata !{metadata !"debug-info-namespace.cpp", metadata !"/home/foo"} |
David Blaikie | 9fb4969 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 37 | !3 = metadata !{i32 0} |
| 38 | !4 = metadata !{metadata !5} |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 39 | !5 = metadata !{i32 786484, i32 0, metadata !6, metadata !"i", metadata !"i", metadata !"_ZN1A1B1iE", metadata !7, i32 2, metadata !10, i32 0, i32 1, i32* @_ZN1A1B1iE, null} ; [ DW_TAG_variable ] [i] [line 2] [def] |
David Blaikie | 72dfb05 | 2013-03-28 02:44:59 +0000 | [diff] [blame] | 40 | !6 = metadata !{i32 786489, metadata !8, metadata !9, metadata !"B", i32 1} ; [ DW_TAG_namespace ] [B] [line 1] |
| 41 | !7 = metadata !{i32 786473, metadata !8} ; [ DW_TAG_file_type ] [/home/foo/foo.cpp] |
David Blaikie | a625e82 | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 42 | !8 = metadata !{metadata !"foo.cpp", metadata !"/home/foo"} |
David Blaikie | 72dfb05 | 2013-03-28 02:44:59 +0000 | [diff] [blame] | 43 | !9 = metadata !{i32 786489, metadata !2, null, metadata !"A", i32 3} ; [ DW_TAG_namespace ] [A] [line 3] |
| 44 | !10 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] |