@@ -0,0 +1,7 @@
+#if defined (__ia64__) || defined (__s390__) || defined (__s390x__)
+#define NOP "nop 0"
+#elif defined (__MMIX__)
+#define NOP "swym 0"
+#else
+#define NOP "nop"
+#endif
@@ -1,14 +1,16 @@
/* { dg-do run } */
/* { dg-options "-g" } */
+#include "nop.h"
+
struct A { int x; unsigned short y; char z[64]; };
void __attribute__((noinline))
foo (struct A *p, char *q)
{
int f = &p->z[p->y] - q;
- asm volatile ("nop");
- asm volatile ("nop" : : "g" (f)); /* { dg-final { gdb-test 12 "f" "14" } } */
+ asm volatile (NOP);
+ asm volatile (NOP : : "g" (f)); /* { dg-final { gdb-test 14 "f" "14" } } */
asm volatile ("" : : "g" (p), "g" (q));
}
@@ -2,12 +2,14 @@
/* { dg-do run } */
/* { dg-options "-g" } */
+#include "nop.h"
+
static inline void
foo (int argx)
{
int varx = argx;
- __asm__ volatile ("nop"); /* { dg-final { gdb-test 10 "argx" "25" } } */
- __asm__ volatile ("nop" : : "g" (varx)); /* { dg-final { gdb-test 10 "varx" "25" } } */
+ __asm__ volatile (NOP); /* { dg-final { gdb-test 12 "argx" "25" } } */
+ __asm__ volatile (NOP : : "g" (varx)); /* { dg-final { gdb-test 12 "varx" "25" } } */
}
int i;