File: dg-scan-symbol-section-exp-P.S

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (50 lines) | stat: -rw-r--r-- 2,260 bytes parent folder | download | duplicates (2)
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
// Test the scan-symbol-section directive.

// { dg-do preprocess }

// The .section directive changes the section for all following symbols.
    .section .text
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_function_1$} {^\.text$} } }
_test_function_1:
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_function_2$} {^\.text$} } }
_test_function_2:

// For ELF targets, the .section directive can take multiple arguments.
    .section .other_text_section,"ax",progbits
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_elf_function$} {^\.other_text_section$} } }
_test_elf_function:

// For Mach-O targets, the .section directive takes a segment name and a section name.
    .section __TEXT,__my_text_section
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_macho_function$} {^__TEXT,__my_text_section$} } }
_test_macho_function:
// Extra whitespace between .section arguments should be ignored.
    .section  __DATA , __testsection
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_macho_var$} {^__DATA,__testsection$} } }
_test_macho_var:

// The .data directive sets the section for all following symbols to '.data'.
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_var_1$} {^\.data$} } }
    .data
_test_var_1:

// The .text directive sets the section for all following symbols to '.text'.
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_function_3$} {^\.text$} } }
    .text
_test_function_3:

// The .const directive sets the section for all following symbols to '.const'.
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_data_1$} {^\.const$} } }
    .const
_test_data_1:

// Other directives do not affect the section of following symbols.
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_var_2$} {^\.data$} } }
    .data
    .p2align 2
    .size _test_var_2, 4
_test_var_2:

// Symbol name patterns can match multiple symbols, and section name patterns
// can match multiple sections.
// { dg-final { scan-symbol-section "dg-scan-symbol-section-exp-P.i" {^_test_function_} {^(\.|__TEXT,).*text} } }