gcc.dg/torture/pr59330.c: Disable for mmix
authorHans-Peter Nilsson <hp@bitrange.com>
Sun, 26 Jul 2020 00:44:02 +0000 (02:44 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Sun, 26 Jul 2020 00:44:02 +0000 (02:44 +0200)
With the dejagnu status-wrapper, there's a reference to write in
each executable, which for mmix in newlib has a reference to a
variable defined in open, which for mmix in newlib has a
reference to sprintf (oops!) and the dependency-chain goes on;
ad finitum there's a reference to malloc, which in default
newlib is colocated with free; the same file
newlib/libc/stdlib/malloc.c.

Not being compiled with -ffunction-sections, they're emitted in
the same section (.text) and thus inseparable: you can't
override just one of them as in this test, or else you'll get:

<X>/pre/mmix/bin/ld: <X>/gccobj/mmix/./newlib/libc.a(lib_a-malloc.o): in function `free':
<X>/gcc/newlib/libc/stdlib/malloc.c:169: multiple definition of `free'; /tmp/ccvRA0zb.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gcc.dg/torture/pr59330.c   -O0  (test for excess errors)

I'm using a dg-skip-if here instead of starting a hardly
scalable dg-do target selector.  I'm not keying on
effective-target unwrapped because the dependency-chain is
target-specific rather than dejagnu status-wrapper-specific.

gcc/testsuite:
* gcc.dg/torture/pr59330.c: Disable for mmix.

gcc/testsuite/gcc.dg/torture/pr59330.c

index 74b832ea3143c682d245be67f34ead99ff071ead..536171e0f181971b659dc3d42a9351908578e158 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-skip-if "free inseparable from malloc when wrapped" { mmix-knuth-mmixware } } */
 
 void free(void *ptr)
 {