xref: /llvm-project/llvm/test/CodeGen/PowerPC/debug-label-fast-isel.ll (revision 427fb35192f1f7bb694a5910b05abc5925a798b2)
12c46ca96SChen Zheng; RUN: llc < %s -mtriple powerpc64-ibm-aix-xcoff | FileCheck %s --check-prefix=CHECKASM
22c46ca96SChen Zheng
32c46ca96SChen Zheng; This is a case copied from test/DebugInfo/Generic/debug-label-mi.ll. This test
42c46ca96SChen Zheng; is to explicitly check that fast isel for XCOFF works as expected for debug
52c46ca96SChen Zheng; related intrinsics.
62c46ca96SChen Zheng
72c46ca96SChen Zheng; CHECKASM: DEBUG_LABEL: foo:top
82c46ca96SChen Zheng; CHECKASM: DEBUG_LABEL: foo:done
92c46ca96SChen Zheng
102c46ca96SChen Zhengsource_filename = "debug-label-mi.c"
112c46ca96SChen Zheng
122c46ca96SChen Zheng; Function Attrs: noinline nounwind optnone
132c46ca96SChen Zhengdefine i32 @foo(i32 signext %a, i32 signext %b) #0 !dbg !4 {
142c46ca96SChen Zhengentry:
152c46ca96SChen Zheng  %a.addr = alloca i32, align 4
162c46ca96SChen Zheng  %b.addr = alloca i32, align 4
172c46ca96SChen Zheng  %sum = alloca i32, align 4
18*427fb351SKai Nacke  store i32 %a, ptr %a.addr, align 4
19*427fb351SKai Nacke  store i32 %b, ptr %b.addr, align 4
202c46ca96SChen Zheng  br label %top
212c46ca96SChen Zheng
222c46ca96SChen Zhengtop:                                              ; preds = %entry
232c46ca96SChen Zheng  call void @llvm.dbg.label(metadata !8), !dbg !9
24*427fb351SKai Nacke  %0 = load i32, ptr %a.addr, align 4
25*427fb351SKai Nacke  %1 = load i32, ptr %b.addr, align 4
262c46ca96SChen Zheng  %add = add nsw i32 %0, %1
27*427fb351SKai Nacke  store i32 %add, ptr %sum, align 4
282c46ca96SChen Zheng  br label %done
292c46ca96SChen Zheng
302c46ca96SChen Zhengdone:                                             ; preds = %top
312c46ca96SChen Zheng  call void @llvm.dbg.label(metadata !10), !dbg !11
32*427fb351SKai Nacke  %2 = load i32, ptr %sum, align 4
332c46ca96SChen Zheng  ret i32 %2
342c46ca96SChen Zheng}
352c46ca96SChen Zheng
362c46ca96SChen Zheng; Function Attrs: nounwind readnone speculatable
372c46ca96SChen Zhengdeclare void @llvm.dbg.label(metadata)
382c46ca96SChen Zheng
392c46ca96SChen Zhengattributes #0 = { noinline nounwind optnone uwtable }
402c46ca96SChen Zheng
412c46ca96SChen Zheng!llvm.dbg.cu = !{!0}
422c46ca96SChen Zheng!llvm.module.flags = !{!3}
432c46ca96SChen Zheng
442c46ca96SChen Zheng!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, emissionKind: FullDebug, enums: !2)
452c46ca96SChen Zheng!1 = !DIFile(filename: "debug-label-mi.c", directory: "./")
462c46ca96SChen Zheng!2 = !{}
472c46ca96SChen Zheng!3 = !{i32 2, !"Debug Info Version", i32 3}
482c46ca96SChen Zheng!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
492c46ca96SChen Zheng!5 = !DISubroutineType(types: !6)
502c46ca96SChen Zheng!6 = !{!7, !7, !7}
512c46ca96SChen Zheng!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
522c46ca96SChen Zheng!8 = !DILabel(scope: !4, name: "top", file: !1, line: 4)
532c46ca96SChen Zheng!9 = !DILocation(line: 4, column: 1, scope: !4)
542c46ca96SChen Zheng!10 = !DILabel(scope: !4, name: "done", file: !1, line: 7)
552c46ca96SChen Zheng!11 = !DILocation(line: 7, column: 1, scope: !4)
56