123 lines · plain
1;; This file tests various ways of specifying the debug info filename in the basic block sections profile.2;; Specifying correct filenames.3; RUN: echo '!test1 M=./test_dirname1/test_filename1' > %t14; RUN: echo '!!0' >> %t15; RUN: echo '!test2 M=.//test_filename2' >> %t16; RUN: echo '!!0' >> %t17; RUN: echo '!test3 M=test_filename3' >> %t18; RUN: echo '!!0' >> %t19; RUN: echo '!test4 M=/test_dirname4/test_filename4' >> %t110; RUN: echo '!!0' >> %t111; RUN: echo '!test5' >> %t112; RUN: echo '!!0' >> %t113; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t1 | FileCheck %s -check-prefix=RIGHT-MODULE14;; Specifying wrong filenames.15; RUN: echo '!test1 M=/test_dirname/test_filename1' > %t216; RUN: echo '!!0' >> %t217; RUN: echo '!test1 M=../test_filename1' >> %t218; RUN: echo '!!0' >> %t219; RUN: echo '!test2 M=.test_filename2' >> %t220; RUN: echo '!!0' >> %t221; RUN: echo '!test4 M=./test_dirname4/test_filename4' >> %t222; RUN: echo '!!0' >> %t223; RUN: echo '!test5 M=any_filename' >> %t124; RUN: echo '!!0' >> %t125; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t2 | FileCheck %s -check-prefix=WRONG-MODULE26 27define dso_local i32 @test1(i32 noundef %0) #0 !dbg !10 {28 %2 = alloca i32, align 429 %3 = alloca i32, align 430 store i32 %0, ptr %3, align 431 %4 = load i32, ptr %3, align 432 %5 = icmp slt i32 %4, 033 br i1 %5, label %6, label %7346: ; preds = %135 store i32 -1, ptr %2, align 436 ret i32 0377:38 ret i32 139}40 41define dso_local i32 @test2(i32 noundef %0) #0 !dbg !11 {42 %2 = alloca i32, align 443 %3 = alloca i32, align 444 store i32 %0, ptr %3, align 445 %4 = load i32, ptr %3, align 446 %5 = icmp slt i32 %4, 047 br i1 %5, label %6, label %7486: ; preds = %149 store i32 -1, ptr %2, align 450 ret i32 0517:52 ret i32 153}54 55define dso_local i32 @test3(i32 noundef %0) #0 !dbg !12 {56 %2 = alloca i32, align 457 %3 = alloca i32, align 458 store i32 %0, ptr %3, align 459 %4 = load i32, ptr %3, align 460 %5 = icmp slt i32 %4, 061 br i1 %5, label %6, label %7626: ; preds = %163 store i32 -1, ptr %2, align 464 ret i32 0657:66 ret i32 167}68 69define dso_local i32 @test4(i32 noundef %0) #0 !dbg !13 {70 %2 = alloca i32, align 471 %3 = alloca i32, align 472 store i32 %0, ptr %3, align 473 %4 = load i32, ptr %3, align 474 %5 = icmp slt i32 %4, 075 br i1 %5, label %6, label %7766: ; preds = %177 store i32 -1, ptr %2, align 478 ret i32 0797:80 ret i32 181}82 83define dso_local i32 @test5(i32 noundef %0) #0 {84 %2 = alloca i32, align 485 %3 = alloca i32, align 486 store i32 %0, ptr %3, align 487 %4 = load i32, ptr %3, align 488 %5 = icmp slt i32 %4, 089 br i1 %5, label %6, label %7906: ; preds = %191 store i32 -1, ptr %2, align 492 ret i32 0937:94 ret i32 195}96 97!llvm.dbg.cu = !{!0, !1, !2, !3}98!llvm.module.flags = !{!8, !9}99 100!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4)101!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5)102!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !6)103!3 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7)104!4 = !DIFile(filename: "test_dirname1/test_filename1", directory: "test_dirname1")105!5 = !DIFile(filename: "test_filename2", directory: "")106!6 = !DIFile(filename: "./test_filename3", directory: ".")107!7 = !DIFile(filename: "/test_dirname4/test_filename4", directory: "/test_dirname4")108!8 = !{i32 7, !"Dwarf Version", i32 5}109!9 = !{i32 2, !"Debug Info Version", i32 3}110!10 = distinct !DISubprogram(name: "test1", scope: !4, unit: !0)111!11 = distinct !DISubprogram(name: "test2", scope: !5, unit: !1)112!12 = distinct !DISubprogram(name: "test3", scope: !6, unit: !2)113!13 = distinct !DISubprogram(name: "test4", scope: !7, unit: !3)114 115;; Check that the split section is created when using the correct module name, or no module name.116;117; RIGHT-MODULE: .section .text.split.test1,"ax",@progbits118; RIGHT-MODULE: .section .text.split.test2,"ax",@progbits119; RIGHT-MODULE: .section .text.split.test3,"ax",@progbits120; RIGHT-MODULE: .section .text.split.test4,"ax",@progbits121; RIGHT-MODULE: .section .text.split.test5,"ax",@progbits122; WRONG-MODULE-NOT: .section .text.split.test{{[1-5]+}},"ax",@progbits123