summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Gperf-simple.c7
-rw-r--r--tests/Gperf-trace.c7
-rw-r--r--tests/Ltest-varargs.c14
-rw-r--r--tests/crasher.c12
4 files changed, 21 insertions, 19 deletions
diff --git a/tests/Gperf-simple.c b/tests/Gperf-simple.c
index ab46008d..21734066 100644
--- a/tests/Gperf-simple.c
+++ b/tests/Gperf-simple.c
@@ -27,6 +27,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <unistd.h>
#include <libunwind.h>
+#include "compiler.h"
#include <sys/resource.h>
#include <sys/time.h>
@@ -53,7 +54,7 @@ gettime (void)
return tv.tv_sec + 1e-6*tv.tv_usec;
}
-static int __attribute__((noinline))
+static int NOINLINE
measure_unwind (int maxlevel, double *step)
{
double stop, start;
@@ -88,7 +89,7 @@ measure_unwind (int maxlevel, double *step)
static int f1 (int, int, double *);
-static int __attribute__((noinline))
+static int NOINLINE
g1 (int level, int maxlevel, double *step)
{
if (level == maxlevel)
@@ -98,7 +99,7 @@ g1 (int level, int maxlevel, double *step)
return f1 (level + 1, maxlevel, step) + level;
}
-static int __attribute__((noinline))
+static int NOINLINE
f1 (int level, int maxlevel, double *step)
{
if (level == maxlevel)
diff --git a/tests/Gperf-trace.c b/tests/Gperf-trace.c
index 7e95e66d..cc4fac68 100644
--- a/tests/Gperf-trace.c
+++ b/tests/Gperf-trace.c
@@ -27,6 +27,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <unistd.h>
#include <libunwind.h>
+#include "compiler.h"
#include <sys/resource.h>
#include <sys/time.h>
@@ -53,7 +54,7 @@ gettime (void)
return tv.tv_sec + 1e-6*tv.tv_usec;
}
-static int __attribute__((noinline))
+static int NOINLINE
measure_unwind (int maxlevel, double *step)
{
double stop, start;
@@ -74,7 +75,7 @@ measure_unwind (int maxlevel, double *step)
static int f1 (int, int, double *);
-static int __attribute__((noinline))
+static int NOINLINE
g1 (int level, int maxlevel, double *step)
{
if (level == maxlevel)
@@ -84,7 +85,7 @@ g1 (int level, int maxlevel, double *step)
return f1 (level + 1, maxlevel, step) + level;
}
-static int __attribute__((noinline))
+static int NOINLINE
f1 (int level, int maxlevel, double *step)
{
if (level == maxlevel)
diff --git a/tests/Ltest-varargs.c b/tests/Ltest-varargs.c
index 603fb57b..dd12c86b 100644
--- a/tests/Ltest-varargs.c
+++ b/tests/Ltest-varargs.c
@@ -1,5 +1,7 @@
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#include "compiler.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -9,12 +11,12 @@ int ok;
int verbose;
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3)
-void a (int, ...) __attribute__((noinline, optimize(0)));
-void b (void) __attribute__((noinline, optimize(0)));
-void c (void) __attribute__((noinline, optimize(0)));
+void a (int, ...) __attribute__((optimize(0)));
+void b (void) __attribute__((optimize(0)));
+void c (void) __attribute__((optimize(0)));
#endif
-void
+void NOINLINE
b (void)
{
void *v[20];
@@ -33,13 +35,13 @@ b (void)
printf ("[%d] %p\n", i, v[i]);
}
-void
+void NOINLINE
c (void)
{
b ();
}
-void
+void NOINLINE
a (int d, ...)
{
switch (d)
diff --git a/tests/crasher.c b/tests/crasher.c
index 9a005b9c..2cf65e8d 100644
--- a/tests/crasher.c
+++ b/tests/crasher.c
@@ -1,5 +1,7 @@
/* This program should crash and produce coredump */
+#include "compiler.h"
+
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -85,24 +87,20 @@ write_maps(char *fname)
#endif
#ifdef __GNUC__
-int a(void) __attribute__((noinline));
-int b(int x) __attribute__((noinline));
-int c(int x) __attribute__((noinline, alias("b")));
+int c(int x) NOINLINE __attribute__((alias("b")));
#define compiler_barrier() asm volatile("");
#else
-int a(void);
-int b(int x);
int c(int x);
#define compiler_barrier()
#endif
-int a(void)
+int NOINLINE a(void)
{
*(volatile int *)32 = 1;
return 1;
}
-int b(int x)
+int NOINLINE b(int x)
{
int r;