Home | History | Annotate | Download | only in X86
      1 # RUN: llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s | FileCheck %s
      2 # This test ensures that the MIR parser parses the metadata machine operands
      3 # correctly.
      4 
      5 --- |
      6 
      7   define i32 @test(i32 %x) #0 !dbg !4 {
      8   entry:
      9     %x.addr = alloca i32, align 4
     10     store i32 %x, i32* %x.addr, align 4
     11     call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
     12     %0 = load i32, i32* %x.addr, align 4, !dbg !15
     13     ret i32 %0, !dbg !15
     14   }
     15 
     16   declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
     17 
     18   attributes #0 = { nounwind "no-frame-pointer-elim"="false" }
     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: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
     26   !1 = !DIFile(filename: "test.ll", directory: "")
     27   !2 = !{}
     28   !3 = !{!4}
     29   !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
     30   !5 = !DIFile(filename: "test.c", directory: "")
     31   !6 = !DISubroutineType(types: !7)
     32   !7 = !{!8, !8}
     33   !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
     34   !9 = !{i32 2, !"Dwarf Version", i32 4}
     35   !10 = !{i32 2, !"Debug Info Version", i32 3}
     36   !11 = !{!"clang version 3.7.0"}
     37   !12 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 4, type: !8)
     38   !13 = !DIExpression()
     39   !14 = !DILocation(line: 4, scope: !4)
     40   !15 = !DILocation(line: 8, scope: !4)
     41 
     42 ...
     43 ---
     44 name:            test
     45 isSSA:           true
     46 tracksRegLiveness: true
     47 registers:
     48   - { id: 0, class: gr32 }
     49 frameInfo:
     50   maxAlignment:  4
     51 stack:
     52   - { id: 0, name: x.addr, size: 4, alignment: 4 }
     53 body: |
     54   bb.0.entry:
     55     liveins: %edi
     56     ; CHECK:      %0 = COPY %edi
     57     ; CHECK-NEXT: DBG_VALUE _, 0, !12, !13
     58     %0 = COPY %edi
     59     DBG_VALUE _, 0, !12, ! 13
     60     MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
     61     %eax = COPY %0
     62     RETQ %eax
     63 ...
     64