summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-xor-2.c
blob: 64a4e42e70673923707767e81b42610027e4b5b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { 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" } } */