Add details output for assume processing.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr57744.c
blob73f524580ac0f192a2f8f01f4d0fab902a834bb3
1 /* { dg-do run { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -O3" } */
5 void abort (void);
7 typedef unsigned U_16 __attribute__((mode(TI)));
9 extern int libat_compare_exchange_16 (U_16 *, U_16 *, U_16, int, int)
10 __attribute__((__noinline__));
12 /* PR 57744: lqarx/stqcx needs even/odd register pairs. The assembler will
13 complain if the compiler gets an odd/even register pair. Create a function
14 which has the 16 byte compare and exchange instructions, but don't actually
15 execute it, so that we can detect these failures on older machines. */
17 int
18 libat_compare_exchange_16 (U_16 *mptr, U_16 *eptr, U_16 newval,
19 int smodel, int fmodel __attribute__((unused)))
21 if (((smodel) == 0))
22 return __atomic_compare_exchange_n (mptr, eptr, newval, 0, 0, 0);
23 else if (((smodel) != 5))
24 return __atomic_compare_exchange_n (mptr, eptr, newval, 0, 4, 0);
25 else
26 return __atomic_compare_exchange_n (mptr, eptr, newval, 0, 5, 0);
29 U_16 a = 1, b = 1, c = -2;
30 volatile int do_test = 0;
32 int main (void)
34 if (do_test && !libat_compare_exchange_16 (&a, &b, c, 0, 0))
35 abort ();
37 return 0;