binutils-gdb/ld/testsuite/ld-plugin/pr22751.c
H.J. Lu fef75122c0 Add a testcase for PR ld/22751
Since dummy.o must be placed before

-Wl,--whole-archive tmpdir/pr22751.a -Wl,--no-whole-archive

to trigger the bug, this patch adds an optional trailing ld options to
run_ld_link_exec_tests.

	PR ld/22751
	* testsuite/config/default.exp (INT128_CFLAGS): New.
	* testsuite/ld-plugin/lto.exp (INT128_CFLAGS): New.
	Run ld/22751 tests.
	* testsuite/ld-plugin/pr22751.c: New file.
	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Add
	ld trailing options.
2018-01-27 16:04:34 -08:00

18 lines
240 B
C

#include <stdio.h>
#ifdef HAS_INT128
volatile __int128 a = 42;
volatile __int128 b = 1;
#else
volatile long long a = 42;
volatile long long b = 1;
#endif
int
main (void)
{
if (((int) (a / b)) == 42)
printf ("PASS\n");
return 0;
}