summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr87261.c
blob: 9b10d03454d1ce97a3800d0a91923b976c9933d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-original" } */

int f1 (int a, int b)
{
 return ~(a|b)|(~a&b);
}

int f2 (int a, int b)
{
 return (a|b)^(a|~b);
}

/* { dg-final { scan-tree-dump-times "return \\~a;" 2 "original" } } */

int f3 (int a, int b)
{
 return ~(a|b)|(a&b);
}

/* { dg-final { scan-tree-dump "return \\~\\(a \\^ b\\);" "original" } } */

int f4 (int a, int b)
{
 return a^b^(~a|b);
}

/* { dg-final { scan-tree-dump "return \\~b \\| a;" "original" } } */

int f5 (int a, int b)
{
 return (a^b)|~(a|b);
}

/* { dg-final { scan-tree-dump "return \\~\\(a \\& b\\);" "original" } } */