cgraph: A COMDAT decl always has non-zero address.
[gcc.git] / gcc / testsuite / c-c++-common / pr43772.c
1 /* { dg-do compile } */
2 /* { dg-options "-Wlogical-op -Wtype-limits" } */
3 #include <limits.h>
4 long long
5 emacs_lseek (long long offset)
6 {
7 return -1-9223372036854775807LL <= offset && offset <= 9223372036854775807LL;
8 }
9
10 long long
11 foo (long long offset)
12 {
13 return -1-9223372036854775807LL > offset && offset > 9223372036854775807LL;
14 }
15
16 long long
17 foo3 (long long offset)
18 {
19 return -1-9223372036854775807LL > offset && offset < 9223372036854775807LL;
20 }
21
22 long long
23 foo2 (long long offset)
24 {
25 if (-1-9223372036854775807LL <= offset) return 0;
26 if (offset <= 9223372036854775807LL) return 0;
27 if (-1-9223372036854775807LL > offset) return 0;
28 if (offset > 9223372036854775807LL) return 0;
29 return 1;
30 }
31
32 # define BOT INT_MIN
33 # define TOP INT_MAX
34
35 long long get_intmax(void);
36 int get_int(void);
37 extern void do_something(void);
38 int main(void)
39 {
40 int i = get_int();
41 long long x = get_intmax();
42 i = (i > BOT && i < TOP); //OK
43 i = (i >= BOT+1 && i <= TOP-1); //OK
44 i = (i >= BOT && i <= TOP); //Oops!
45 }