61 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses the metadata machine operands3# correctly.4 5--- |6 7 define i32 @test(i32 %x) #0 !dbg !4 {8 entry:9 %x.addr = alloca i32, align 410 store i32 %x, ptr %x.addr, align 411 call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !12, metadata !DIExpression()), !dbg !1312 %0 = load i32, ptr %x.addr, align 4, !dbg !1413 ret i32 %0, !dbg !1414 }15 16 declare void @llvm.dbg.declare(metadata, metadata, metadata) #117 18 attributes #0 = { nounwind "frame-pointer"="none" }19 attributes #1 = { nounwind readnone }20 21 !llvm.dbg.cu = !{!0}22 !llvm.module.flags = !{!9, !10}23 !llvm.ident = !{!11}24 25 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)26 !1 = !DIFile(filename: "test.ll", directory: "")27 !2 = !{}28 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)29 !5 = !DIFile(filename: "test.c", directory: "")30 !6 = !DISubroutineType(types: !7)31 !7 = !{!8, !8}32 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)33 !9 = !{i32 2, !"Dwarf Version", i32 4}34 !10 = !{i32 2, !"Debug Info Version", i32 3}35 !11 = !{!"clang version 3.7.0"}36 !12 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 4, type: !8)37 !13 = !DILocation(line: 4, scope: !4)38 !14 = !DILocation(line: 8, scope: !4)39 40...41---42name: test43tracksRegLiveness: true44registers:45 - { id: 0, class: gr32 }46frameInfo:47 maxAlignment: 448stack:49 - { id: 0, name: x.addr, size: 4, alignment: 4 }50body: |51 bb.0.entry:52 liveins: $edi53 ; CHECK: %0:gr32 = COPY $edi54 ; CHECK-NEXT: DBG_VALUE $noreg, 0, !11, !DIExpression()55 %0 = COPY $edi56 DBG_VALUE _, 0, !12, !DIExpression(), debug-location !1357 MOV32mr %stack.0.x.addr, 1, _, 0, _, %058 $eax = COPY %059 RET64 $eax60...61