Jyotsna Verma | 9dea095 | 2013-04-10 19:53:26 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t |
David Blaikie | 2881da7 | 2013-03-20 19:39:15 +0000 | [diff] [blame] | 4 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 5 | ; CHECK: debug_info contents |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 6 | ; CHECK: [[NS1:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace |
David Blaikie | 4f278f9 | 2013-03-20 06:27:06 +0000 | [diff] [blame] | 7 | ; CHECK-NEXT: DW_AT_name{{.*}} = "A" |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 8 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1:".*debug-info-namespace.cpp"]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 9 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(5) |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 10 | ; CHECK-NOT: NULL |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 11 | ; CHECK: [[NS2:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace |
David Blaikie | a354eed | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 12 | ; CHECK-NEXT: DW_AT_name{{.*}} = "B" |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 13 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2:".*foo.cpp"]]) |
Frederic Riss | 0982e69 | 2014-09-05 07:21:50 +0000 | [diff] [blame] | 14 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(1) |
David Blaikie | a354eed | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 15 | ; CHECK-NOT: NULL |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 16 | ; CHECK: [[I:0x[0-9a-f]*]]:{{ *}}DW_TAG_variable |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 17 | ; CHECK-NEXT: DW_AT_name{{.*}}= "i" |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 18 | ; CHECK: [[VAR_FWD:0x[0-9a-f]*]]:{{ *}}DW_TAG_variable |
| 19 | ; CHECK-NEXT: DW_AT_name{{.*}}= "var_fwd" |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 20 | ; CHECK-NOT: NULL |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 21 | ; CHECK: [[FOO:0x[0-9a-f]*]]:{{ *}}DW_TAG_structure_type |
| 22 | ; CHECK-NEXT: DW_AT_name{{.*}}= "foo" |
| 23 | ; CHECK-NEXT: DW_AT_declaration |
| 24 | ; CHECK-NOT: NULL |
| 25 | ; CHECK: [[BAR:0x[0-9a-f]*]]:{{ *}}DW_TAG_structure_type |
| 26 | ; CHECK-NEXT: DW_AT_name{{.*}}= "bar" |
David Blaikie | 3c2fff3 | 2014-05-27 18:37:48 +0000 | [diff] [blame] | 27 | ; CHECK: [[FUNC1:.*]]: DW_TAG_subprogram |
| 28 | ; CHECK-NOT: DW_TAG |
| 29 | ; CHECK: DW_AT_MIPS_linkage_name |
| 30 | ; CHECK-NOT: DW_TAG |
| 31 | ; CHECK: DW_AT_name{{.*}}= "f1" |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 32 | ; CHECK: [[BAZ:0x[0-9a-f]*]]:{{.*}}DW_TAG_typedef |
| 33 | ; CHECK-NOT: DW_TAG |
| 34 | ; CHECK: DW_AT_name{{.*}}= "baz" |
| 35 | ; CHECK: [[VAR_DECL:0x[0-9a-f]*]]:{{.*}}DW_TAG_variable |
| 36 | ; CHECK-NOT: DW_TAG |
| 37 | ; CHECK: DW_AT_name{{.*}}= "var_decl" |
| 38 | ; CHECK-NOT: DW_TAG |
| 39 | ; CHECK: DW_AT_declaration |
| 40 | ; CHECK: [[FUNC_DECL:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram |
| 41 | ; CHECK-NOT: DW_TAG |
| 42 | ; CHECK: DW_AT_name{{.*}}= "func_decl" |
| 43 | ; CHECK-NOT: DW_TAG |
| 44 | ; CHECK: DW_AT_declaration |
| 45 | ; CHECK: [[FUNC_FWD:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram |
| 46 | ; CHECK-NOT: DW_TAG |
| 47 | ; CHECK: DW_AT_name{{.*}}= "func_fwd" |
| 48 | ; CHECK-NOT: DW_AT_declaration |
David Blaikie | 3c2fff3 | 2014-05-27 18:37:48 +0000 | [diff] [blame] | 49 | ; CHECK: DW_TAG_subprogram |
| 50 | ; CHECK-NOT: DW_TAG |
| 51 | ; CHECK: DW_AT_MIPS_linkage_name |
| 52 | ; CHECK-NOT: DW_TAG |
| 53 | ; CHECK: DW_AT_name{{.*}}= "f1" |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 54 | ; CHECK: NULL |
| 55 | |
| 56 | ; CHECK-NOT: NULL |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 57 | ; CHECK: DW_TAG_imported_module |
| 58 | ; This is a bug, it should be in F2 but it inherits the file from its |
| 59 | ; enclosing scope |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 60 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 61 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(15) |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 62 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS2]]}) |
David Blaikie | 6baa776 | 2013-05-07 17:57:13 +0000 | [diff] [blame] | 63 | ; CHECK: NULL |
| 64 | ; CHECK-NOT: NULL |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 65 | |
David Blaikie | 3c2fff3 | 2014-05-27 18:37:48 +0000 | [diff] [blame] | 66 | ; CHECK: DW_TAG_imported_module |
| 67 | ; Same bug as above, this should be F2, not F1 |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 68 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 69 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(18) |
David Blaikie | 3c2fff3 | 2014-05-27 18:37:48 +0000 | [diff] [blame] | 70 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]}) |
| 71 | ; CHECK-NOT: NULL |
| 72 | |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 73 | ; CHECK: DW_TAG_subprogram |
David Blaikie | 2f75351 | 2014-05-23 21:11:46 +0000 | [diff] [blame] | 74 | ; CHECK-NOT: DW_TAG |
| 75 | ; CHECK: DW_AT_MIPS_linkage_name |
| 76 | ; CHECK-NOT: DW_TAG |
| 77 | ; CHECK: DW_AT_name{{.*}}= "func" |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 78 | ; CHECK-NOT: NULL |
| 79 | ; CHECK: DW_TAG_imported_module |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 80 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 81 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(26) |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 82 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]}) |
| 83 | ; CHECK-NOT: NULL |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 84 | ; CHECK: DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 85 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 86 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(27) |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 87 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FOO]]}) |
| 88 | ; CHECK-NOT: NULL |
| 89 | ; CHECK: DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 90 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 91 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(28) |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 92 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[BAR]]}) |
| 93 | ; CHECK-NOT: NULL |
| 94 | ; CHECK: DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 95 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 96 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(29) |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 97 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC1]]}) |
| 98 | ; CHECK-NOT: NULL |
| 99 | ; CHECK: DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 100 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 101 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(30) |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 102 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[I]]}) |
| 103 | ; CHECK-NOT: NULL |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 104 | ; CHECK: DW_TAG_imported_declaration |
| 105 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
| 106 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(31) |
| 107 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[BAZ]]}) |
| 108 | ; CHECK-NOT: NULL |
David Blaikie | 2a40c14 | 2014-04-06 06:29:01 +0000 | [diff] [blame] | 109 | ; CHECK: [[X:0x[0-9a-f]*]]:{{ *}}DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 110 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 111 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(32) |
David Blaikie | e63d5d1 | 2013-05-20 22:50:35 +0000 | [diff] [blame] | 112 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]}) |
| 113 | ; CHECK-NEXT: DW_AT_name{{.*}}"X" |
| 114 | ; CHECK-NOT: NULL |
David Blaikie | 2a40c14 | 2014-04-06 06:29:01 +0000 | [diff] [blame] | 115 | ; CHECK: DW_TAG_imported_declaration |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 116 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 117 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(33) |
David Blaikie | e63d5d1 | 2013-05-20 22:50:35 +0000 | [diff] [blame] | 118 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[X]]}) |
| 119 | ; CHECK-NEXT: DW_AT_name{{.*}}"Y" |
| 120 | ; CHECK-NOT: NULL |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 121 | ; CHECK: DW_TAG_imported_declaration |
| 122 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
| 123 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(34) |
| 124 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[VAR_DECL]]}) |
| 125 | ; CHECK: DW_TAG_imported_declaration |
| 126 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
| 127 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(35) |
| 128 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC_DECL]]}) |
| 129 | ; CHECK: DW_TAG_imported_declaration |
| 130 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
| 131 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(36) |
| 132 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[VAR_FWD]]}) |
| 133 | ; CHECK: DW_TAG_imported_declaration |
| 134 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
| 135 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(37) |
| 136 | ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC_FWD]]}) |
| 137 | |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 138 | ; CHECK: DW_TAG_lexical_block |
| 139 | ; CHECK-NOT: NULL |
| 140 | ; CHECK: DW_TAG_imported_module |
Frederic Riss | 955724e | 2014-09-22 12:36:04 +0000 | [diff] [blame] | 141 | ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]]) |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 142 | ; CHECK-NEXT: DW_AT_decl_line{{.*}}(23) |
| 143 | ; CHECK-NEXT: DW_AT_import{{.*}}=> |
David Blaikie | 6baa776 | 2013-05-07 17:57:13 +0000 | [diff] [blame] | 144 | ; CHECK: NULL |
| 145 | ; CHECK: NULL |
David Blaikie | 3c2fff3 | 2014-05-27 18:37:48 +0000 | [diff] [blame] | 146 | ; CHECK: NULL |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 147 | |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 148 | ; IR generated from clang/test/CodeGenCXX/debug-info-namespace.cpp, file paths |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 149 | ; changed to protect the guilty. The C++ source code is: |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 150 | ; // RUN... |
| 151 | ; // RUN... |
| 152 | ; // RUN... |
| 153 | ; |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 154 | ; namespace A { |
David Blaikie | a354eed | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 155 | ; #line 1 "foo.cpp" |
| 156 | ; namespace B { |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 157 | ; extern int i; |
| 158 | ; int f1() { return 0; } |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 159 | ; void f1(int) { } |
| 160 | ; struct foo; |
| 161 | ; struct bar { }; |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 162 | ; typedef bar baz; |
| 163 | ; extern int var_decl; |
| 164 | ; void func_decl(void); |
| 165 | ; extern int var_fwd; |
| 166 | ; void func_fwd(void); |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 167 | ; } |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 168 | ; } |
| 169 | ; namespace A { |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 170 | ; using namespace B; |
David Blaikie | a354eed | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 171 | ; } |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 172 | ; |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 173 | ; using namespace A; |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 174 | ; namespace E = A; |
| 175 | ; int B::i = f1(); |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 176 | ; int func(bool b) { |
| 177 | ; if (b) { |
| 178 | ; using namespace A::B; |
| 179 | ; return i; |
| 180 | ; } |
| 181 | ; using namespace A; |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 182 | ; using B::foo; |
| 183 | ; using B::bar; |
| 184 | ; using B::f1; |
| 185 | ; using B::i; |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 186 | ; using B::baz; |
David Blaikie | e63d5d1 | 2013-05-20 22:50:35 +0000 | [diff] [blame] | 187 | ; namespace X = A; |
| 188 | ; namespace Y = X; |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 189 | ; using B::var_decl; |
| 190 | ; using B::func_decl; |
| 191 | ; using B::var_fwd; |
| 192 | ; using B::func_fwd; |
David Blaikie | e63d5d1 | 2013-05-20 22:50:35 +0000 | [diff] [blame] | 193 | ; return i + X::B::i + Y::B::i; |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 194 | ; } |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 195 | ; |
| 196 | ; namespace A { |
| 197 | ; using B::i; |
| 198 | ; namespace B { |
| 199 | ; int var_fwd = i; |
| 200 | ; } |
| 201 | ; } |
| 202 | ; void B::func_fwd() {} |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 203 | |
David Blaikie | a354eed | 2013-03-20 19:14:16 +0000 | [diff] [blame] | 204 | @_ZN1A1B1iE = global i32 0, align 4 |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 205 | @_ZN1A1B7var_fwdE = global i32 0, align 4 |
| 206 | @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_debug_info_namespace.cpp, i8* null }] |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 207 | |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 208 | ; Function Attrs: nounwind ssp uwtable |
| 209 | define i32 @_ZN1A1B2f1Ev() #0 { |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 210 | entry: |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 211 | ret i32 0, !dbg !60 |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 212 | } |
| 213 | |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 214 | ; Function Attrs: nounwind ssp uwtable |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 215 | define void @_ZN1A1B2f1Ei(i32) #0 { |
| 216 | entry: |
| 217 | %.addr = alloca i32, align 4 |
| 218 | store i32 %0, i32* %.addr, align 4 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 219 | call void @llvm.dbg.declare(metadata i32* %.addr, metadata !61, metadata !62), !dbg !63 |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 220 | ret void, !dbg !64 |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 224 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
David Blaikie | 3b6038b | 2013-05-08 06:01:41 +0000 | [diff] [blame] | 225 | |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 226 | define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { |
| 227 | entry: |
| 228 | %call = call i32 @_ZN1A1B2f1Ev(), !dbg !65 |
| 229 | store i32 %call, i32* @_ZN1A1B1iE, align 4, !dbg !65 |
| 230 | ret void, !dbg !65 |
| 231 | } |
| 232 | |
| 233 | ; Function Attrs: nounwind ssp uwtable |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 234 | define i32 @_Z4funcb(i1 zeroext %b) #0 { |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 235 | entry: |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 236 | %retval = alloca i32, align 4 |
| 237 | %b.addr = alloca i8, align 1 |
| 238 | %frombool = zext i1 %b to i8 |
| 239 | store i8 %frombool, i8* %b.addr, align 1 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 240 | call void @llvm.dbg.declare(metadata i8* %b.addr, metadata !66, metadata !62), !dbg !67 |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 241 | %0 = load i8* %b.addr, align 1, !dbg !68 |
| 242 | %tobool = trunc i8 %0 to i1, !dbg !68 |
| 243 | br i1 %tobool, label %if.then, label %if.end, !dbg !68 |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 244 | |
| 245 | if.then: ; preds = %entry |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 246 | %1 = load i32* @_ZN1A1B1iE, align 4, !dbg !69 |
| 247 | store i32 %1, i32* %retval, !dbg !69 |
| 248 | br label %return, !dbg !69 |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 249 | |
| 250 | if.end: ; preds = %entry |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 251 | %2 = load i32* @_ZN1A1B1iE, align 4, !dbg !70 |
| 252 | %3 = load i32* @_ZN1A1B1iE, align 4, !dbg !70 |
| 253 | %add = add nsw i32 %2, %3, !dbg !70 |
| 254 | %4 = load i32* @_ZN1A1B1iE, align 4, !dbg !70 |
| 255 | %add1 = add nsw i32 %add, %4, !dbg !70 |
| 256 | store i32 %add1, i32* %retval, !dbg !70 |
| 257 | br label %return, !dbg !70 |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 258 | |
| 259 | return: ; preds = %if.end, %if.then |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 260 | %5 = load i32* %retval, !dbg !71 |
| 261 | ret i32 %5, !dbg !71 |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 262 | } |
| 263 | |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 264 | define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" { |
| 265 | entry: |
| 266 | %0 = load i32* @_ZN1A1B1iE, align 4, !dbg !72 |
| 267 | store i32 %0, i32* @_ZN1A1B7var_fwdE, align 4, !dbg !72 |
| 268 | ret void, !dbg !72 |
| 269 | } |
| 270 | |
| 271 | ; Function Attrs: nounwind ssp uwtable |
| 272 | define void @_ZN1A1B8func_fwdEv() #0 { |
| 273 | entry: |
| 274 | ret void, !dbg !73 |
| 275 | } |
| 276 | |
| 277 | define internal void @_GLOBAL__sub_I_debug_info_namespace.cpp() section "__TEXT,__StaticInit,regular,pure_instructions" { |
| 278 | entry: |
| 279 | call void @__cxx_global_var_init(), !dbg !74 |
| 280 | call void @__cxx_global_var_init1(), !dbg !74 |
| 281 | ret void, !dbg !74 |
| 282 | } |
| 283 | |
| 284 | attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
David Blaikie | 684fc53 | 2013-05-06 23:33:07 +0000 | [diff] [blame] | 285 | attributes #1 = { nounwind readnone } |
David Blaikie | f55abea | 2013-04-22 06:12:31 +0000 | [diff] [blame] | 286 | |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 287 | !llvm.dbg.cu = !{!0} |
Frederic Riss | fdccfc1 | 2014-11-18 02:46:11 +0000 | [diff] [blame] | 288 | !llvm.module.flags = !{!57, !58} |
| 289 | !llvm.ident = !{!59} |
David Blaikie | fdabd48 | 2013-03-20 05:15:37 +0000 | [diff] [blame] | 290 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 291 | !0 = !{!"0x11\004\00clang version 3.6.0 \000\00\000\00\001", !1, !2, !3, !9, !30, !33} ; [ DW_TAG_compile_unit ] [/tmp/debug-info-namespace.cpp] [DW_LANG_C_plus_plus] |
| 292 | !1 = !{!"debug-info-namespace.cpp", !"/tmp"} |
| 293 | !2 = !{} |
| 294 | !3 = !{!4, !8} |
| 295 | !4 = !{!"0x13\00foo\005\000\000\000\004\000", !5, !6, null, null, null, null, !"_ZTSN1A1B3fooE"} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ] |
| 296 | !5 = !{!"foo.cpp", !"/tmp"} |
| 297 | !6 = !{!"0x39\00B\001", !5, !7} ; [ DW_TAG_namespace ] [B] [line 1] |
| 298 | !7 = !{!"0x39\00A\005", !1, null} ; [ DW_TAG_namespace ] [A] [line 5] |
| 299 | !8 = !{!"0x13\00bar\006\008\008\000\000\000", !5, !6, null, !2, null, null, !"_ZTSN1A1B3barE"} ; [ DW_TAG_structure_type ] [bar] [line 6, size 8, align 8, offset 0] [def] [from ] |
| 300 | !9 = !{!10, !14, !17, !21, !25, !26, !27} |
| 301 | !10 = !{!"0x2e\00f1\00f1\00_ZN1A1B2f1Ev\003\000\001\000\000\00256\000\003", !5, !6, !11, null, i32 ()* @_ZN1A1B2f1Ev, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f1] |
| 302 | !11 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 303 | !12 = !{!13} |
| 304 | !13 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] |
| 305 | !14 = !{!"0x2e\00f1\00f1\00_ZN1A1B2f1Ei\004\000\001\000\000\00256\000\004", !5, !6, !15, null, void (i32)* @_ZN1A1B2f1Ei, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [f1] |
| 306 | !15 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 307 | !16 = !{null, !13} |
| 308 | !17 = !{!"0x2e\00__cxx_global_var_init\00__cxx_global_var_init\00\0020\001\001\000\000\00256\000\0020", !5, !18, !19, null, void ()* @__cxx_global_var_init, null, null, !2} ; [ DW_TAG_subprogram ] [line 20] [local] [def] [__cxx_global_var_init] |
| 309 | !18 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/tmp/foo.cpp] |
| 310 | !19 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !20, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 311 | !20 = !{null} |
| 312 | !21 = !{!"0x2e\00func\00func\00_Z4funcb\0021\000\001\000\000\00256\000\0021", !5, !18, !22, null, i32 (i1)* @_Z4funcb, null, null, !2} ; [ DW_TAG_subprogram ] [line 21] [def] [func] |
| 313 | !22 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !23, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 314 | !23 = !{!13, !24} |
| 315 | !24 = !{!"0x24\00bool\000\008\008\000\000\002", null, null} ; [ DW_TAG_base_type ] [bool] [line 0, size 8, align 8, offset 0, enc DW_ATE_boolean] |
| 316 | !25 = !{!"0x2e\00__cxx_global_var_init1\00__cxx_global_var_init1\00\0044\001\001\000\000\00256\000\0044", !5, !18, !19, null, void ()* @__cxx_global_var_init1, null, null, !2} ; [ DW_TAG_subprogram ] [line 44] [local] [def] [__cxx_global_var_init1] |
| 317 | !26 = !{!"0x2e\00func_fwd\00func_fwd\00_ZN1A1B8func_fwdEv\0047\000\001\000\000\00256\000\0047", !5, !6, !19, null, void ()* @_ZN1A1B8func_fwdEv, null, null, !2} ; [ DW_TAG_subprogram ] [line 47] [def] [func_fwd] |
| 318 | !27 = !{!"0x2e\00\00\00_GLOBAL__sub_I_debug_info_namespace.cpp\000\001\001\000\000\0064\000\000", !1, !28, !29, null, void ()* @_GLOBAL__sub_I_debug_info_namespace.cpp, null, null, !2} ; [ DW_TAG_subprogram ] [line 0] [local] [def] |
| 319 | !28 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp/debug-info-namespace.cpp] |
| 320 | !29 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 321 | !30 = !{!31, !32} |
| 322 | !31 = !{!"0x34\00i\00i\00_ZN1A1B1iE\0020\000\001", !6, !18, !13, i32* @_ZN1A1B1iE, null} ; [ DW_TAG_variable ] [i] [line 20] [def] |
| 323 | !32 = !{!"0x34\00var_fwd\00var_fwd\00_ZN1A1B7var_fwdE\0044\000\001", !6, !18, !13, i32* @_ZN1A1B7var_fwdE, null} ; [ DW_TAG_variable ] [var_fwd] [line 44] [def] |
| 324 | !33 = !{!34, !35, !36, !37, !40, !41, !42, !43, !44, !45, !47, !48, !49, !51, !54, !55, !56} |
| 325 | !34 = !{!"0x3a\0015\00", !7, !6} ; [ DW_TAG_imported_module ] |
| 326 | !35 = !{!"0x3a\0018\00", !0, !7} ; [ DW_TAG_imported_module ] |
| 327 | !36 = !{!"0x8\0019\00E", !0, !7} ; [ DW_TAG_imported_declaration ] |
| 328 | !37 = !{!"0x3a\0023\00", !38, !6} ; [ DW_TAG_imported_module ] |
| 329 | !38 = !{!"0xb\0022\0010\001", !5, !39} ; [ DW_TAG_lexical_block ] [/tmp/foo.cpp] |
| 330 | !39 = !{!"0xb\0022\007\000", !5, !21} ; [ DW_TAG_lexical_block ] [/tmp/foo.cpp] |
| 331 | !40 = !{!"0x3a\0026\00", !21, !7} ; [ DW_TAG_imported_module ] |
| 332 | !41 = !{!"0x8\0027\00", !21, !"_ZTSN1A1B3fooE"} ; [ DW_TAG_imported_declaration ] |
| 333 | !42 = !{!"0x8\0028\00", !21, !"_ZTSN1A1B3barE"} ; [ DW_TAG_imported_declaration ] |
| 334 | !43 = !{!"0x8\0029\00", !21, !14} ; [ DW_TAG_imported_declaration ] |
| 335 | !44 = !{!"0x8\0030\00", !21, !31} ; [ DW_TAG_imported_declaration ] |
| 336 | !45 = !{!"0x8\0031\00", !21, !46} ; [ DW_TAG_imported_declaration ] |
| 337 | !46 = !{!"0x16\00baz\007\000\000\000\000", !5, !6, !"_ZTSN1A1B3barE"} ; [ DW_TAG_typedef ] [baz] [line 7, size 0, align 0, offset 0] [from _ZTSN1A1B3barE] |
| 338 | !47 = !{!"0x8\0032\00X", !21, !7} ; [ DW_TAG_imported_declaration ] |
| 339 | !48 = !{!"0x8\0033\00Y", !21, !47} ; [ DW_TAG_imported_declaration ] |
| 340 | !49 = !{!"0x8\0034\00", !21, !50} ; [ DW_TAG_imported_declaration ] |
| 341 | !50 = !{!"0x34\00var_decl\00var_decl\00_ZN1A1B8var_declE\008\000\000", !6, !18, !13, null, null} ; [ DW_TAG_variable ] [var_decl] [line 8] |
| 342 | !51 = !{!"0x8\0035\00", !21, !52} ; [ DW_TAG_imported_declaration ] |
| 343 | !52 = !{!"0x2e\00func_decl\00func_decl\00_ZN1A1B9func_declEv\009\000\000\000\000\00256\000\000", !5, !6, !19, null, null, null, null, !53} ; [ DW_TAG_subprogram ] [line 9] [scope 0] [func_decl] |
| 344 | !53 = !{!"0x24"} |
| 345 | !54 = !{!"0x8\0036\00", !21, !32} ; [ DW_TAG_imported_declaration ] |
| 346 | !55 = !{!"0x8\0037\00", !21, !26} ; [ DW_TAG_imported_declaration ] |
| 347 | !56 = !{!"0x8\0042\00", !7, !31} ; [ DW_TAG_imported_declaration ] |
| 348 | !57 = !{i32 2, !"Dwarf Version", i32 2} |
| 349 | !58 = !{i32 2, !"Debug Info Version", i32 2} |
| 350 | !59 = !{!"clang version 3.6.0 "} |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 351 | !60 = !MDLocation(line: 3, column: 12, scope: !10) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 352 | !61 = !{!"0x101\00\0016777220\000", !14, !18, !13} ; [ DW_TAG_arg_variable ] [line 4] |
| 353 | !62 = !{!"0x102"} ; [ DW_TAG_expression ] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 354 | !63 = !MDLocation(line: 4, column: 12, scope: !14) |
| 355 | !64 = !MDLocation(line: 4, column: 16, scope: !14) |
| 356 | !65 = !MDLocation(line: 20, column: 12, scope: !17) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 357 | !66 = !{!"0x101\00b\0016777237\000", !21, !18, !24} ; [ DW_TAG_arg_variable ] [b] [line 21] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 358 | !67 = !MDLocation(line: 21, column: 15, scope: !21) |
| 359 | !68 = !MDLocation(line: 22, column: 7, scope: !21) |
| 360 | !69 = !MDLocation(line: 24, column: 5, scope: !38) |
| 361 | !70 = !MDLocation(line: 38, column: 3, scope: !21) |
| 362 | !71 = !MDLocation(line: 39, column: 1, scope: !21) |
| 363 | !72 = !MDLocation(line: 44, column: 15, scope: !25) |
| 364 | !73 = !MDLocation(line: 47, column: 21, scope: !26) |
| 365 | !74 = !MDLocation(line: 0, scope: !75) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 366 | !75 = !{!"0xb\000", !5, !27} ; [ DW_TAG_lexical_block ] [/tmp/foo.cpp] |