summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-xor-2.c
blob: 35337c9c9e83c4132192ed34c499023fa8f9aa23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) {
	return ~(a ^ -(b + 1));
}

int g (int a, int b) {
	return b ^ a;
}

unsigned int h (unsigned int a, unsigned int b) {
	return ~(-(b + 1) ^ a);
}

/* { dg-final { scan-tree-dump-times "b \\^ a" 3 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */