File: coff-relocs.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (81 lines) | stat: -rw-r--r-- 2,387 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
; RUN: llc -mtriple mipsel-windows -filetype=obj < %s | obj2yaml | FileCheck %s

; CHECK:  Machine:         IMAGE_FILE_MACHINE_R4000



; CHECK:  - Name:            .text
; CHECK:    Relocations:

declare void @bar()
define i32 @foo_jmp() {
  call i32 @bar()
; CHECK:      - VirtualAddress:  8
; CHECK:        SymbolName:      bar
; CHECK:        Type:            IMAGE_REL_MIPS_JMPADDR
  ret i32 0
}

@var = external global i32
define i32 @foo_var() {
  %1 = load i32, i32* @var
; CHECK:      - VirtualAddress:  32
; CHECK:        SymbolName:      var
; CHECK:        Type:            IMAGE_REL_MIPS_REFHI
; CHECK:      - VirtualAddress:  32
; CHECK:        SymbolName:      .text
; CHECK:        Type:            IMAGE_REL_MIPS_PAIR
; CHECK:      - VirtualAddress:  40
; CHECK:        SymbolName:      var
; CHECK:        Type:            IMAGE_REL_MIPS_REFLO
  ret i32 %1
}



; CHECK:  - Name:            .data
; CHECK:    Relocations:

%struct._PTR = type { ptr }

@var1 = internal global %struct._PTR { ptr @var2 }
@var2 = external global i32
; CHECK:      - VirtualAddress:  0
; CHECK:        SymbolName:      var2
; CHECK:        Type:            IMAGE_REL_MIPS_REFWORD




; CHECK:  - Name:            '.debug$S'
; CHECK:    Relocations:

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3, !4}

!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, emissionKind: FullDebug)
!1 = !DIFile(filename: "dummy.c", directory: "/tmp/private")
!2 = !{i32 2, !"CodeView", i32 1}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{i32 1, !"wchar_size", i32 2}
!5 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !6, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0)
!6 = !DISubroutineType(types: !7)
!7 = !{null}
!8 = !DILocation(line: 3, scope: !5)

define dso_local void @foo_dbg() #0 !dbg !5 {
  ret void, !dbg !8
; CHECK:      - VirtualAddress:  92
; CHECK:        SymbolName:      foo_dbg
; CHECK:        Type:            IMAGE_REL_MIPS_SECREL
; CHECK:      - VirtualAddress:  96
; CHECK:        SymbolName:      foo_dbg
; CHECK:        Type:            IMAGE_REL_MIPS_SECTION
; CHECK:      - VirtualAddress:  148
; CHECK:        SymbolName:      foo_dbg
; CHECK:        Type:            IMAGE_REL_MIPS_SECREL
; CHECK:      - VirtualAddress:  152
; CHECK:        SymbolName:      foo_dbg
; CHECK:        Type:            IMAGE_REL_MIPS_SECTION
}