brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 0861fcb Raw
74 lines · plain
1; RUN: llc --filetype=obj --mtriple=loongarch64 %s -o %t.o2; RUN: llvm-readobj -r %t.o | FileCheck %s3; RUN: llc --filetype=obj --mtriple=loongarch64 --mattr=+relax %s -o %t.r4; RUN: llvm-readobj -r %t.r | FileCheck %s5 6; CHECK:      Relocations [7; CHECK-NEXT:   Section ({{.*}}) .rela.text {8; CHECK-NEXT:     0x14 R_LARCH_PCALA_HI20 sym 0x09; CHECK-NEXT:     0x14 R_LARCH_RELAX - 0x010; CHECK-NEXT:     0x18 R_LARCH_PCALA_LO12 sym 0x011; CHECK-NEXT:     0x18 R_LARCH_RELAX - 0x012; CHECK-NEXT:   }13; CHECK-NEXT:   Section ({{.*}}) .rela.debug_info {14; CHECK-NEXT:     0x8 R_LARCH_32 .debug_abbrev 0x015; CHECK-NEXT:     0x11 R_LARCH_32 .L0 0x016; CHECK-NEXT:     0x15 R_LARCH_32 .Lline_table_start0 0x017; CHECK-NEXT:     0x1B R_LARCH_ADD32 .L0 0x018; CHECK-NEXT:     0x1B R_LARCH_SUB32 .L0 0x019; CHECK-NEXT:     0x1F R_LARCH_32 .L0 0x020; CHECK-NEXT:     0x25 R_LARCH_ADD32 .L0 0x021; CHECK-NEXT:     0x25 R_LARCH_SUB32 .L0 0x022; CHECK-NEXT:   }23; CHECK:        Section ({{.*}}) .rela.debug_frame {24; CHECK-NEXT:     0x1C R_LARCH_32 .L0 0x025; CHECK-NEXT:     0x20 R_LARCH_64 .L0 0x026; CHECK-NEXT:     0x28 R_LARCH_ADD64 .L0 0x027; CHECK-NEXT:     0x28 R_LARCH_SUB64 .L0 0x028; CHECK-NEXT:     0x3F R_LARCH_ADD6 .L0 0x029; CHECK-NEXT:     0x3F R_LARCH_SUB6 .L0 0x030; CHECK-NEXT:   }31; CHECK-NEXT:   Section ({{.*}}) .rela.debug_line {32; CHECK-NEXT:     0x22 R_LARCH_32 .debug_line_str 0x033; CHECK-NEXT:     0x31 R_LARCH_32 .debug_line_str 0x234; CHECK-NEXT:     0x46 R_LARCH_32 .debug_line_str 0x935; CHECK-NEXT:     0x4F R_LARCH_64 .L0 0x036; CHECK-NEXT:     0x5F R_LARCH_ADD16 .L0 0x037; CHECK-NEXT:     0x5F R_LARCH_SUB16 .L0 0x038; CHECK-NEXT:   }39; CHECK-NEXT: ]40 41; ModuleID = 'test.c'42source_filename = "test.c"43target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"44target triple = "loongarch64"45 46; Function Attrs: noinline nounwind optnone47define dso_local signext i32 @foo() #0 !dbg !8 {48  call void asm sideeffect ".cfi_remember_state\0A\09.cfi_adjust_cfa_offset 16\0A\09nop\0A\09la.pcrel $$t0, sym\0A\09nop\0A\09.cfi_restore_state\0A\09", ""() #1, !dbg !12, !srcloc !1349  ret i32 0, !dbg !1450}51 52attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="loongarch64" "target-features"="+64bit,+d,+f,+ual,+relax" }53attributes #1 = { nounwind }54 55!llvm.dbg.cu = !{!0}56!llvm.module.flags = !{!2, !3, !4, !5, !6}57!llvm.ident = !{!7}58 59!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)60!1 = !DIFile(filename: "test.c", directory: ".", checksumkind: CSK_MD5, checksum: "f44d6d71bc4da58b4abe338ca507c007", source: "int foo()\0A{\0A  asm volatile(\0A    \22.cfi_remember_state\\n\\t\22\0A    \22.cfi_adjust_cfa_offset 16\\n\\t\22\0A    \22nop\\n\\t\22\0A    \22la.pcrel $t0, sym\\n\\t\22\0A    \22nop\\n\\t\22\0A    \22.cfi_restore_state\\n\\t\22);\0A  return 0;\0A}\0A")61!2 = !{i32 7, !"Dwarf Version", i32 5}62!3 = !{i32 2, !"Debug Info Version", i32 3}63!4 = !{i32 1, !"wchar_size", i32 4}64!5 = !{i32 7, !"direct-access-external-data", i32 0}65!6 = !{i32 7, !"frame-pointer", i32 2}66!7 = !{!"clang"}67!8 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !9, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0)68!9 = !DISubroutineType(types: !10)69!10 = !{!11}70!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)71!12 = !DILocation(line: 3, column: 3, scope: !8)72!13 = !{i64 34, i64 56, i64 92, i64 106, i64 134, i64 148, i64 177}73!14 = !DILocation(line: 10, column: 3, scope: !8)74