1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s 2 3 define void @Foo(i32 %a, i32 %b) { 4 entry: 5 call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !2) 6 ; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata !2) 7 %0 = add i32 %a, 1 ; <i32> [#uses=1] 8 %two = add i32 %b, %0 ; <i32> [#uses=0] 9 %1 = alloca i32 ; <i32*> [#uses=1] 10 11 call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32* %1}) 12 ; CHECK: metadata !{i32* %1}, metadata !{i32* %1} 13 call void @llvm.dbg.declare(metadata !{i32 %two}, metadata !{i32 %0}) 14 ; CHECK: metadata !{i32 %two}, metadata !{i32 %0} 15 call void @llvm.dbg.declare(metadata !{i32 %0}, metadata !{i32* %1, i32 %0}) 16 ; CHECK: metadata !{i32 %0}, metadata !{i32* %1, i32 %0} 17 call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32 %b, i32 %0}) 18 ; CHECK: metadata !{i32* %1}, metadata !{i32 %b, i32 %0} 19 call void @llvm.dbg.declare(metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"}) 20 ; CHECK: metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"} 21 call void @llvm.dbg.declare(metadata !{i32 %b}, metadata !{metadata !0, i32 %two}) 22 ; CHECK: metadata !{i32 %b}, metadata !{metadata !0, i32 %two} 23 24 call void @llvm.dbg.value(metadata !{ i32 %a }, i64 0, metadata !1) 25 ; CHECK: metadata !{i32 %a}, i64 0, metadata !1 26 call void @llvm.dbg.value(metadata !{ i32 %0 }, i64 25, metadata !0) 27 ; CHECK: metadata !{i32 %0}, i64 25, metadata !0 28 call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !3) 29 ; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata !3) 30 call void @llvm.dbg.value(metadata !3, i64 12, metadata !2) 31 ; CHECK: metadata !3, i64 12, metadata !2 32 33 ret void, !foo !0, !bar !1 34 ; CHECK: ret void, !foo !0, !bar !1 35 } 36 37 !0 = metadata !{i32 662302, i32 26, metadata !1, null} 38 !1 = metadata !{i32 4, metadata !"foo"} 39 !2 = metadata !{metadata !"bar"} 40 !3 = metadata !{metadata !"foo"} 41 42 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone 43 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone 44 45 !foo = !{ !0 } 46 !bar = !{ !1 } 47