1# REQUIRES: mips
2# In case of linking PIC and non-PIC code together and generation
3# of a relocatable object, all PIC symbols should have STO_MIPS_PIC
4# flag in the symbol table of the output file.
5
6# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-npic.o
7# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
8# RUN:   %p/Inputs/mips-pic.s -o %t-pic.o
9# RUN: ld.lld -r %t-npic.o %t-pic.o -o %t-rel.o
10# RUN: llvm-readobj --symbols %t-rel.o | FileCheck %s
11
12# CHECK:      Symbol {
13# CHECK:        Name: main
14# CHECK-NEXT:   Value:
15# CHECK-NEXT:   Size:
16# CHECK-NEXT:   Binding: Local
17# CHECK-NEXT:   Type: None
18# CHECK-NEXT:   Other: 0
19# CHECK-NEXT:   Section: .text
20# CHECK-NEXT: }
21# CHECK:      Symbol {
22# CHECK:        Name: foo1a
23# CHECK-NEXT:   Value:
24# CHECK-NEXT:   Size:
25# CHECK-NEXT:   Binding: Global
26# CHECK-NEXT:   Type: Function
27# CHECK-NEXT:   Other [
28# CHECK-NEXT:     STO_MIPS_PIC
29# CHECK-NEXT:   ]
30# CHECK-NEXT:   Section: .text
31# CHECK-NEXT: }
32# CHECK-NEXT: Symbol {
33# CHECK-NEXT:   Name: foo1b
34# CHECK-NEXT:   Value:
35# CHECK-NEXT:   Size:
36# CHECK-NEXT:   Binding: Global
37# CHECK-NEXT:   Type: Function
38# CHECK-NEXT:   Other [
39# CHECK-NEXT:     STO_MIPS_PIC
40# CHECK-NEXT:   ]
41# CHECK-NEXT:   Section: .text
42# CHECK-NEXT: }
43# CHECK-NEXT: Symbol {
44# CHECK-NEXT:   Name: foo2
45# CHECK-NEXT:   Value:
46# CHECK-NEXT:   Size:
47# CHECK-NEXT:   Binding: Global
48# CHECK-NEXT:   Type: Function
49# CHECK-NEXT:   Other [
50# CHECK-NEXT:     STO_MIPS_PIC
51# CHECK-NEXT:   ]
52# CHECK-NEXT:   Section: .text
53# CHECK-NEXT: }
54
55  .text
56main:
57  nop
58