Commit a677307d by Jakub Jelinek Committed by Jakub Jelinek

nop.h: New file.

	* gcc.dg/guality/nop.h: New file.
	* gcc.dg/guality/asm-1.c: Include it and use NOP macro instead of
	"nop".  Adjust line numbers in gdb-test.
	* gcc.dg/guality/pr43329-1.c: Likewise.

From-SVN: r166859
parent 84ec98d2
2010-11-17 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/guality/nop.h: New file.
* gcc.dg/guality/asm-1.c: Include it and use NOP macro instead of
"nop". Adjust line numbers in gdb-test.
* gcc.dg/guality/pr43329-1.c: Likewise.
2010-11-16 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/defaulted20.C: New.
......
/* { 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));
}
......
#if defined (__ia64__) || defined (__s390__) || defined (__s390x__)
#define NOP "nop 0"
#elif defined (__MMIX__)
#define NOP "swym 0"
#else
#define NOP "nop"
#endif
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment