summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr28045.c
blob: f2d16646ca269fddc5499084120a2cf3ad366187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do run } */

extern void abort(void);
struct a
{
   unsigned int bits : 1;
   signed long val : ((sizeof(long) * 8) - 1);
};
int Fnegate (struct a b)
{
  if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))
      && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1))
     return 0 ;
  abort ();
}
int main ()
{
  struct a b = {1, 1};
  Fnegate (b);
  return 0;
}