aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/bit1neg-1.c
blob: 2f123fbb9b5cd883dd2d5a9404a26dfd8f3818e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

struct f
{
  int a:1;
};

void g(struct f *a)
{
 int t = a->a;
 t = -t;
 a->a = t;
}
void g1(struct f *a, int b)
{
 int t = b;
 t = -t;
 a->a = t;
}
/* the 2 negates should have been removed as this is basically the same
   as (-a) & 1. */
/* { dg-final { scan-tree-dump-not " = -" "optimized" } } */