Evgeniy Stepanov | 8537d99 | 2017-03-09 00:03:37 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -constmerge -S | FileCheck %s |
| 2 | |
| 3 | ; CHECK: = constant i32 1, !dbg [[A:![0-9]+]], !dbg [[B:![0-9]+]] |
| 4 | @a = internal constant i32 1, !dbg !0 |
| 5 | @b = unnamed_addr constant i32 1, !dbg !9 |
| 6 | |
| 7 | define void @test1(i32** %P1, i32** %P2) { |
| 8 | store i32* @a, i32** %P1 |
| 9 | store i32* @b, i32** %P2 |
| 10 | ret void |
| 11 | } |
| 12 | |
| 13 | !llvm.dbg.cu = !{!2} |
| 14 | !llvm.module.flags = !{!7, !8} |
| 15 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 16 | ; CHECK: [[A]] = !DIGlobalVariableExpression(var: [[VA:![0-9]+]], expr: !DIExpression()) |
Evgeniy Stepanov | 8537d99 | 2017-03-09 00:03:37 +0000 | [diff] [blame] | 17 | ; CHECK: [[VA]] = distinct !DIGlobalVariable(name: "y" |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 18 | ; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[VB:![0-9]+]], expr: !DIExpression()) |
Evgeniy Stepanov | 8537d99 | 2017-03-09 00:03:37 +0000 | [diff] [blame] | 19 | ; CHECK: [[VB]] = distinct !DIGlobalVariable(name: "x" |
| 20 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 21 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Evgeniy Stepanov | 8537d99 | 2017-03-09 00:03:37 +0000 | [diff] [blame] | 22 | !1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) |
| 23 | !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 5.0.0 (trunk 297227) (llvm/trunk 297234)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 24 | !3 = !DIFile(filename: "1.cc", directory: "/build") |
| 25 | !4 = !{} |
| 26 | !5 = !{!0} |
| 27 | !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 28 | !7 = !{i32 2, !"Dwarf Version", i32 4} |
| 29 | !8 = !{i32 2, !"Debug Info Version", i32 3} |
| 30 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 31 | !9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression()) |
Evgeniy Stepanov | 8537d99 | 2017-03-09 00:03:37 +0000 | [diff] [blame] | 32 | !10 = distinct !DIGlobalVariable(name: "y", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) |