binutils-gdb/ld/testsuite/ld-elf/pr21964-1c.c
Nick Clifton 95e96e052a Fix linker tests to compile with gcc-12.
PR 21964
	* testsuite/ld-elf/pr21964-1a.c: Fix array comparisons.
	* testsuite/ld-elf/pr21964-1b.c: Likewise.
	* testsuite/ld-elf/pr21964-1c.c: Likewise.
	* testsuite/ld-elf/pr21964-2a.c: Likewise.
	* testsuite/ld-elf/pr21964-2b.c: Likewise.
	* testsuite/ld-elf/pr21964-3a.c: Likewise.
2022-03-01 10:10:20 +00:00

30 lines
473 B
C

#include <stdio.h>
extern int foo1 (void);
extern int foo2 (void);
extern int __start___verbose[];
extern int __stop___verbose[];
static int my_var __attribute__((used, section("__verbose"))) = 6;
int
bar (void)
{
if (& __start___verbose[0] == & __stop___verbose[0])
return -1;
if (__start___verbose[0] != 6)
return -2;
else
return 0;
}
int
main ()
{
if (bar () == 0
&& foo1 () == 0
&& foo2 () == 0)
printf ("PASS\n");
return 0;
}