On 20/08/18 10:33, Richard Biener wrote:
On Mon, 20 Aug 2018, Szabolcs Nagy wrote:
On 02/08/18 09:30, Richard Biener wrote:
...
+ clock_gettime(CLOCK_REALTIME, &t);
this fails on targets without clock_gettime (baremetal)
or targets that need -lrt at link time.
can we use something else here?
e.g. time(&t) works on baremetal and does not depend on -lrt.
You'd have to check that the original bug still reproduces. Since
it depends on scheduling chances may be that it is fragile :/
I suppose we could restrict the testcase to { *-*-linux }?
i decided to restrict it to linux:
clock_gettime is not available on some baremetal targets
and may require -lrt on some non-linux targets.
OK for trunk?
gcc/testsuite/ChangeLog:
2018-08-21 Szabolcs Nagy <szabolcs.n...@arm.com>
* g++.dg/torture/pr86763.C: Restrict to *-*-linux*.
diff --git a/gcc/testsuite/g++.dg/torture/pr86763.C b/gcc/testsuite/g++.dg/torture/pr86763.C
index 79523b24850..8455ac9ce12 100644
--- a/gcc/testsuite/g++.dg/torture/pr86763.C
+++ b/gcc/testsuite/g++.dg/torture/pr86763.C
@@ -1,6 +1,6 @@
-// { dg-do run }
+// { dg-do run { target { *-*-linux* } } }
// { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" }
-// { dg-additional-options "-lrt" { target *-*-linux-gnu } }
+// { dg-additional-options "-lrt" }
#include <cstdint>
#include <cassert>