Test to cover LRA fix in r215119.

gcc/testsuite/

	* gcc.target/mips/20140928.c: New test.

From-SVN: r215663
This commit is contained in:
Robert Suchanek 2014-09-28 08:54:36 +00:00 committed by Matthew Fortune
parent b69f0860bb
commit fcf239c09b
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2014-09-28 Robert Suchanek <robert.suchanek@imgtec.com>
* gcc.target/mips/20140928.c: New test.
2014-09-27 Andi Kleen <ak@linux.intel.com>
* gcc.target/i386/nop-mcount.c: Only run on Linux.

View File

@ -0,0 +1,20 @@
/* { dg-do compile } */
NOMIPS16 int NoBarrier_AtomicIncrement(volatile int* ptr, int increment) {
int temp, temp2;
__asm__ __volatile__(".set push\n"
".set noreorder\n"
"1:\n"
"ll %0, 0(%3)\n"
"addu %1, %0, %2\n"
"sc %1, 0(%3)\n"
"beqz %1, 1b\n"
"nop\n"
"addu %1, %0, %2\n"
".set pop\n"
: "=&r" (temp), "=&r" (temp2)
: "Ir" (increment), "r" (ptr)
: "memory");
return temp2;
}