summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr15785-1.c
blob: 47cd3d7b01bc90f74169f5d5a1d201b3508f5882 (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
36
37
38
39
40
41
42
/* { dg-do link } */

extern void link_error ();

void a (int x) {
	if (~ (~x) - x)
		link_error ();
}
void b (int x) {
	if (- (-x) - x)
		link_error ();
}

void c (int x) {
	if (!(- (~x) - x))
		link_error ();
}

void d (int x) {
	if (!(~ (-x) - x))
		link_error ();
}

void e (int x) {
	if (x + ~(x - 1))
		link_error ();
}

void f (int x) {
	if (x + ~(x + (-1)))
		link_error ();
}

int main (int argc, char *argv[]) {
	a(argc);
	b(argc);
	c(argc);
	d(argc);
	e(argc);
	f(argc);
	return 0;
}