xref: /llvm-project/llvm/test/CodeGen/ARM/arange-ldr.ll (revision ad253446208a06902d3bc4939ac7a64f8026cc84)
1; RUN: llc %s -o - -generate-arange-section | FileCheck %s
2
3; Make sure that emitting constants for ldr and emitting arange work together.
4; Emitting constants must come before emitting aranges since emitting aranges can end arbitrary sections.
5
6target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
7target triple = "armv7-unknown-linux-android21"
8
9; CHECK:       ldr r7, .Ltmp[[#TMP:]]
10
11; CHECK:      .Ltmp[[#TMP]]:
12; CHECK-NEXT: .long  83040
13
14; CHECK: .section        .debug_aranges
15
16define dso_local void @a() local_unnamed_addr !dbg !4 {
17entry:
18  call void asm sideeffect "  ldr r7, =${0:c}\0A", "i"(i32 83040)
19  ret void
20}
21
22!llvm.dbg.cu = !{!0}
23!llvm.module.flags = !{!3}
24
25!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, splitDebugInlining: false, nameTableKind: None)
26!1 = !DIFile(filename: "/tmp/a.c", directory: "/tmp/")
27!2 = !{}
28!3 = !{i32 2, !"Debug Info Version", i32 3}
29!4 = distinct !DISubprogram(name: "a", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
30!5 = !DIFile(filename: "/tmp/a.c", directory: "")
31!6 = !DISubroutineType(types: !2)
32