annotate gcc/testsuite/gcc.dg/Waddress-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/48778 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-Waddress" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #define NULL ((void *) 0)
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #define M1(b) ((b) != NULL ? 0 : (b))
kono
parents:
diff changeset
8 #define M2(b) ((b) == NULL ? 0 : (b))
kono
parents:
diff changeset
9 #define M3(b) (NULL != (b) ? 0 : (b))
kono
parents:
diff changeset
10 #define M4(b) (NULL == (b) ? 0 : (b))
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 int
kono
parents:
diff changeset
13 func (int b)
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 if (M1 (&b) > 0)
kono
parents:
diff changeset
16 return 1;
kono
parents:
diff changeset
17 if (M2 (&b) > 0)
kono
parents:
diff changeset
18 return 2;
kono
parents:
diff changeset
19 if (M3 (&b) > 0)
kono
parents:
diff changeset
20 return 3;
kono
parents:
diff changeset
21 if (M4 (&b) > 0)
kono
parents:
diff changeset
22 return 4;
kono
parents:
diff changeset
23 return 0;
kono
parents:
diff changeset
24 }