[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / Object / dyn-rel-relocation.test
blob3738fb06eef960bc732fa048543a20874b9b6de2
1 // Check that 'llvm-readobj --dyn-relocations' shows dynamic relocations
2 // if they have REL record format.
4 // dyn-rel.so.elf-mips
5 // % cat test.s
6 //   .globl  __start
7 // __start:
8 //   nop
9 // 
10 //   .data
11 //   .type  v1,@object
12 //   .size  v1,4
13 // v1:
14 //   .word 0
15 // 
16 //   .globl v2
17 //   .type  v2,@object
18 //   .size  v2,8
19 // v2:
20 //   .word v2+4 # R_MIPS_32 target v2 addend 4
21 //   .word v1   # R_MIPS_32 target v1 addend 0
23 // % llvm-mc -filetype=obj -triple=mips-unknown-linux -o test.o test.s
24 // % ld  -m elf32btsmip -shared -o dyn-rel.so.elf-mips test.o
26 RUN: llvm-readobj -r --dyn-relocations --expand-relocs \
27 RUN:   %p/Inputs/dyn-rel.so.elf-mips | FileCheck %s
29 // CHECK:      Relocations [
30 // CHECK-NEXT:   Section (6) .rel.dyn {
31 // CHECK-NEXT:     Relocation {
32 // CHECK-NEXT:       Offset: 0x0
33 // CHECK-NEXT:       Type: R_MIPS_NONE (0)
34 // CHECK-NEXT:       Symbol: - (0)
35 // CHECK-NEXT:     }
36 // CHECK-NEXT:     Relocation {
37 // CHECK-NEXT:       Offset: 0x102F8
38 // CHECK-NEXT:       Type: R_MIPS_REL32 (3)
39 // CHECK-NEXT:       Symbol: - (0)
40 // CHECK-NEXT:     }
41 // CHECK-NEXT:     Relocation {
42 // CHECK-NEXT:       Offset: 0x102F4
43 // CHECK-NEXT:       Type: R_MIPS_REL32 (3)
44 // CHECK-NEXT:       Symbol: v2 (9)
45 // CHECK-NEXT:     }
46 // CHECK-NEXT:   }
47 // CHECK-NEXT: ]
49 // CHECK:      Dynamic Relocations {
50 // CHECK-NEXT:   Relocation {
51 // CHECK-NEXT:     Offset: 0x0
52 // CHECK-NEXT:     Type: R_MIPS_NONE (0)
53 // CHECK-NEXT:     Symbol: -
54 // CHECK-NEXT:   }
55 // CHECK-NEXT:   Relocation {
56 // CHECK-NEXT:     Offset: 0x102F8
57 // CHECK-NEXT:     Type: R_MIPS_REL32 (3)
58 // CHECK-NEXT:     Symbol: -
59 // CHECK-NEXT:   }
60 // CHECK-NEXT:   Relocation {
61 // CHECK-NEXT:     Offset: 0x102F4
62 // CHECK-NEXT:     Type: R_MIPS_REL32 (3)
63 // CHECK-NEXT:     Symbol: v2
64 // CHECK-NEXT:   }
65 // CHECK-NEXT: }