Add _FloatN, _FloatNx tests for __builtin_fpclassify.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr58670.c
blobba9fce71f9e1bbae0aa1f6b7dc016f01e72806f0
1 /* PR middle-end/58670 */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
4 #if defined (__i386__) || defined (__x86_64__)
5 #define ASM_STR "btsl $1, %0; jc %l[lab]"
6 #endif
8 __attribute__((noinline, noclone)) int
9 foo (int a, int b)
11 if (a)
12 return -3;
13 #ifdef ASM_STR
14 asm volatile goto (ASM_STR : : "m" (b) : "memory" : lab);
15 return 0;
16 lab:
17 #endif
18 return 0;
21 int
22 bar (int a, int b)
24 if (a)
25 return -3;
26 #ifdef ASM_STR
27 asm volatile goto (ASM_STR : : "m" (b) : "memory" : lab);
28 return 0;
29 lab:
30 #endif
31 return 0;
34 int
35 main ()
37 if (foo (1, 0) != -3
38 || foo (0, 3) != 0
39 || foo (1, 0) != -3
40 || foo (0, 0) != 0
41 || bar (1, 0) != -3
42 || bar (0, 3) != 0
43 || bar (1, 0) != -3
44 || bar (0, 0) != 0)
45 __builtin_abort ();
46 return 0;