[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ELF / many-sections-2.s
blobb782306aad2ee2d9ad5649ba56cc65674505797e
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t
2 // RUN: llvm-readobj -S %t | FileCheck --check-prefix=SECTIONS %s
3 // RUN: llvm-readobj --symbols %t | FileCheck --check-prefix=SYMBOLS %s
5 // Test that we create a .symtab_shndx if a symbol points to a section
6 // numbered SHN_LORESERVE (0xFF00) or higher.
8 // SECTIONS: Name: .symtab_shndx
10 // Test that we don't create a symbol for the symtab_shndx section.
11 // SYMBOLS-NOT: symtab_shndx
13 // SYMBOLS: Name: dm (0)
14 // SYMBOLS: Value: 0x0
15 // SYMBOLS: Size: 0
16 // SYMBOLS: Binding: Local (0x0)
17 // SYMBOLS: Type: Section (0x3)
18 // SYMBOLS: Other: 0
19 // SYMBOLS: Section: dm (0xFF00)
20 // SYMBOLS-NEXT: }
22 // Test that both a and b show up in the correct section.
23 // SYMBOLS: Name: a
24 // SYMBOLS-NEXT: Value: 0x0
25 // SYMBOLS-NEXT: Size: 0
26 // SYMBOLS-NEXT: Binding: Local (0x0)
27 // SYMBOLS-NEXT: Type: None (0x0)
28 // SYMBOLS-NEXT: Other: 0
29 // SYMBOLS-NEXT: Section: dm (0xFF00)
30 // SYMBOLS-NEXT: }
31 // SYMBOLS-NEXT: Symbol {
32 // SYMBOLS-NEXT: Name: b
33 // SYMBOLS-NEXT: Value: 0x1
34 // SYMBOLS-NEXT: Size: 0
35 // SYMBOLS-NEXT: Binding: Local (0x0)
36 // SYMBOLS-NEXT: Type: None (0x0)
37 // SYMBOLS-NEXT: Other: 0
38 // SYMBOLS-NEXT: Section: dm (0xFF00)
39 // SYMBOLS-NEXT: }
40 // SYMBOLS-NEXT:]
42 .macro gen_sections4 x
43 .section a\x
44 .section b\x
45 .section c\x
46 .section d\x
47 .endm
49 .macro gen_sections8 x
50 gen_sections4 a\x
51 gen_sections4 b\x
52 .endm
54 .macro gen_sections16 x
55 gen_sections8 a\x
56 gen_sections8 b\x
57 .endm
59 .macro gen_sections32 x
60 gen_sections16 a\x
61 gen_sections16 b\x
62 .endm
64 .macro gen_sections64 x
65 gen_sections32 a\x
66 gen_sections32 b\x
67 .endm
69 .macro gen_sections128 x
70 gen_sections64 a\x
71 gen_sections64 b\x
72 .endm
74 .macro gen_sections256 x
75 gen_sections128 a\x
76 gen_sections128 b\x
77 .endm
79 .macro gen_sections512 x
80 gen_sections256 a\x
81 gen_sections256 b\x
82 .endm
84 .macro gen_sections1024 x
85 gen_sections512 a\x
86 gen_sections512 b\x
87 .endm
89 .macro gen_sections2048 x
90 gen_sections1024 a\x
91 gen_sections1024 b\x
92 .endm
94 .macro gen_sections4096 x
95 gen_sections2048 a\x
96 gen_sections2048 b\x
97 .endm
99 .macro gen_sections8192 x
100 gen_sections4096 a\x
101 gen_sections4096 b\x
102 .endm
104 .macro gen_sections16384 x
105 gen_sections8192 a\x
106 gen_sections8192 b\x
107 .endm
109 .macro gen_sections32768 x
110 gen_sections16384 a\x
111 gen_sections16384 b\x
112 .endm
114 .section foo
115 .section bar
117 gen_sections32768 a
118 gen_sections16384 b
119 gen_sections8192 c
120 gen_sections4096 d
121 gen_sections2048 e
122 gen_sections1024 f
123 gen_sections512 g
124 gen_sections128 h
125 gen_sections64 i
126 gen_sections32 j
127 gen_sections16 k
128 gen_sections8 l
129 gen_sections4 m
132 b = a + 1
133 .long dm