OSDN Git Service

* gcc.dg/torture/builtin-modf-1.c: Remove -funsafe-math-optimizations.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr25718-1.c
1 /* { dg-do run } */
2 /* PR 25718: invalid constant operand to the "bound" insn; error at
3    assembly time.  We'll make sure the code is correct to: run a few
4    example values.  */
5
6 extern void exit (int);
7 extern void abort (void);
8 unsigned __attribute__ ((__noinline__)) foo(unsigned a)
9 {
10   unsigned l;
11   l = (a >= (~0u - 512) ? (~0u - 512) : a);
12   return l;
13 }
14
15 int
16 main (void)
17 {
18   if (foo ((unsigned) -512) != (unsigned) -513
19       || foo ((unsigned) -514) != (unsigned) -514
20       || foo ((unsigned) -513) != (unsigned) -513
21       || foo ((unsigned) -1) != (unsigned) -513
22       || foo (513) != 513
23       || foo (0) != 0)
24     abort ();
25
26   exit (0);
27 }