1# REQUIRES: mips
2# Check MIPS .MIPS.options section generation.
3
4# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t1.o
5# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
6# RUN:         %S/Inputs/mips-dynamic.s -o %t2.o
7# RUN: echo "SECTIONS { \
8# RUN:          . = 0x100000000; \
9# RUN:          .got  : { *(.got) } }" > %t.rel.script
10# RUN: ld.lld %t1.o %t2.o --gc-sections --script %t.rel.script -shared -o %t.so
11# RUN: llvm-readobj -l --symbols -A %t.so | FileCheck %s
12
13  .text
14  .globl  __start
15__start:
16    lui  $gp, %hi(%neg(%gp_rel(g1)))
17
18# CHECK:      ProgramHeader {
19# CHECK:        Type: PT_MIPS_OPTIONS
20# CHECK-NEXT:   Offset:
21# CHECK-NEXT:   VirtualAddress:
22# CHECK-NEXT:   PhysicalAddress:
23# CHECK-NEXT:   FileSize:
24# CHECK-NEXT:   MemSize:
25# CHECK-NEXT:   Flags [
26# CHECK-NEXT:     PF_R
27# CHECK-NEXT:   ]
28# CHECK-NEXT:   Alignment: 8
29# CHECK-NEXT: }
30
31# CHECK:      Name: _gp
32# CHECK-NEXT: Value: 0x[[GP:[0-9A-F]+]]
33
34# CHECK:      MIPS Options {
35# CHECK-NEXT:   ODK_REGINFO {
36# CHECK-NEXT:     GP: 0x[[GP]]
37# CHECK-NEXT:     General Mask: 0x10000001
38# CHECK-NEXT:     Co-Proc Mask0: 0x0
39# CHECK-NEXT:     Co-Proc Mask1: 0x0
40# CHECK-NEXT:     Co-Proc Mask2: 0x0
41# CHECK-NEXT:     Co-Proc Mask3: 0x0
42# CHECK-NEXT:   }
43# CHECK-NEXT: }
44