Mercurial > hg > CbC > CbC_gcc
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 |
rev | line source |
---|---|
111 | 1 /* PR c/48778 */ |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-Waddress" } */ | |
4 | |
5 #define NULL ((void *) 0) | |
6 | |
7 #define M1(b) ((b) != NULL ? 0 : (b)) | |
8 #define M2(b) ((b) == NULL ? 0 : (b)) | |
9 #define M3(b) (NULL != (b) ? 0 : (b)) | |
10 #define M4(b) (NULL == (b) ? 0 : (b)) | |
11 | |
12 int | |
13 func (int b) | |
14 { | |
15 if (M1 (&b) > 0) | |
16 return 1; | |
17 if (M2 (&b) > 0) | |
18 return 2; | |
19 if (M3 (&b) > 0) | |
20 return 3; | |
21 if (M4 (&b) > 0) | |
22 return 4; | |
23 return 0; | |
24 } |