File: data-sym-multi-pool.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A12.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 959,712 kB
  • sloc: cpp: 3,275,382; ansic: 2,061,766; ada: 840,956; f90: 208,513; makefile: 76,132; asm: 73,433; xml: 50,448; exp: 34,146; sh: 32,436; objc: 15,637; fortran: 14,012; python: 11,991; pascal: 6,787; awk: 4,779; perl: 3,054; yacc: 338; ml: 285; lex: 201; haskell: 122
file content (45 lines) | stat: -rw-r--r-- 1,245 bytes parent folder | download
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
/* { dg-do compile } */
/* { dg-options "-mips16 -mcode-readable=yes -fno-tree-vrp" } */
/* { dg-skip-if "per-function expected output" { *-*-* } { "-flto" } { "" } } */

/* This testcase generates multiple constant pools within a function body.  */

#define C(a,b) \
  if (a > b)  goto gt; \
  if (a < b)  goto lt;

#define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b)
#define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3])

#define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y)
#define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8)

unsigned foo(int x[64], int y[64])
{
  C256(x,y);

  return 0x01234567;
 gt:
  return 0x12345678;
 lt:
  return 0xF0123456;
}

/*  Check that:
1. The __pend symbol is emitted as STT_FUNCTION followed by instructions:
	.type	__pend_frob_<X>, @function	# Symbol # must match label.
__pend_foo_<X>: 				# The symbol must match.
	.insn
.L<Y>:

2. __pend symbol at end of function has type STT_OBJECT

	.type	__pend_foo_<X>, @object
__pend_foo_<X>:
	.insn
	.end	foo

  */

/* { dg-final { scan-assembler "\t\\.type\t(__pend_foo_\[0-9\]+), @function\n\\1:\n\t\\.insn\n.L\[0-9\]+:\n" } }  */
/* { dg-final { scan-assembler "\t\\.type\t(__pend_foo_\[0-9\]+), @object\n\\1:\n\t\\.end\tfoo\n" } }  */