From: Robert Suchanek Date: Sun, 28 Sep 2014 08:54:36 +0000 (+0000) Subject: Test to cover LRA fix in r215119. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fcf239c09ba0d4e0ebb96fa86fdf6cbf61b1ac51;p=gcc.git Test to cover LRA fix in r215119. gcc/testsuite/ * gcc.target/mips/20140928.c: New test. From-SVN: r215663 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 30893283f40..870ca0e3952 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-09-28 Robert Suchanek + + * gcc.target/mips/20140928.c: New test. + 2014-09-27 Andi Kleen * gcc.target/i386/nop-mcount.c: Only run on Linux. diff --git a/gcc/testsuite/gcc.target/mips/20140928.c b/gcc/testsuite/gcc.target/mips/20140928.c new file mode 100644 index 00000000000..1b55bdd357c --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/20140928.c @@ -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; +}