diff options
author | Romain Geissler @ Amadeus <romain.geissler@amadeus.com> | 2018-03-06 17:06:44 +0100 |
---|---|---|
committer | Dave Watson <davejwatson@fb.com> | 2018-03-06 08:06:44 -0800 |
commit | 54c1afdd51802c4d84f06826522b0e52022e89f6 (patch) | |
tree | 2fe1ba927db1e651c199c5674f4717f7bf67196d | |
parent | 7f04c2032f1a2328072f3a3733abf74a72188458 (diff) | |
download | libunwind-54c1afdd51802c4d84f06826522b0e52022e89f6.tar.gz |
Fix crasher test for gcc >= 8 when using -O2 or -O3. (#67)
-rw-r--r-- | tests/crasher.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/crasher.c b/tests/crasher.c index 24c78054..9df57095 100644 --- a/tests/crasher.c +++ b/tests/crasher.c @@ -87,6 +87,11 @@ write_maps(char *fname) #endif #ifdef __GNUC__ +#ifndef __clang__ +// Gcc >= 8 became too good at inlining aliase c into b when using -O2 or -O3, +// so force -O1 in all cases, otherwise a frame will be missing in the tests. +#pragma GCC optimize "-O1" +#endif int c(int x) NOINLINE ALIAS(b); #define compiler_barrier() asm volatile(""); #else |