Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/warn/Walways-true-1.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
10 | 10 |
11 void | 11 void |
12 bar (int a) | 12 bar (int a) |
13 { | 13 { |
14 lab: | 14 lab: |
15 if (foo) // { dg-warning "always evaluate as|never be NULL" "correct warning" } | 15 if (foo) // { dg-warning "7:the address of .int foo\\(int\\). will never be NULL" "correct warning" } |
16 foo (0); | 16 foo (0); |
17 if (foo (1)) | 17 if (foo (1)) |
18 ; | 18 ; |
19 if (&i) // { dg-warning "always evaluate as|never be NULL" "correct warning" } | 19 if (&i) // { dg-warning "7:the address of .i. will never be NULL" "correct warning" } |
20 foo (2); | 20 foo (2); |
21 if (i) | 21 if (i) |
22 foo (3); | 22 foo (3); |
23 if (&a) // { dg-warning "always evaluate as|never be NULL" "correct warning" } | 23 if (&a) // { dg-warning "7:the address of .a. will never be NULL" "correct warning" } |
24 foo (4); | 24 foo (4); |
25 if (a) | 25 if (a) |
26 foo (5); | 26 foo (5); |
27 if (&&lab) // { dg-warning "always evaluate as|never be NULL" "correct warning" } | 27 if (&&lab) // { dg-warning "7:the address of .lab. will never be NULL" "correct warning" } |
28 foo (6); | 28 foo (6); |
29 if (foo == 0) // { dg-warning "never be NULL" "correct warning" } | 29 if (foo == 0) // { dg-warning "11:the address of .int foo\\(int\\). will never be NULL" "correct warning" } |
30 foo (7); | 30 foo (7); |
31 if (foo (1) == 0) | 31 if (foo (1) == 0) |
32 foo (8); | 32 foo (8); |
33 if (&i == 0) // { dg-warning "never be NULL" "correct warning" } | 33 if (&i == 0) // { dg-warning "10:the address of .i. will never be NULL" "correct warning" } |
34 foo (9); | 34 foo (9); |
35 if (i == 0) | 35 if (i == 0) |
36 foo (10); | 36 foo (10); |
37 if (&a == 0) // { dg-warning "never be NULL" "correct warning" } | 37 if (&a == 0) // { dg-warning "10:the address of .a. will never be NULL" "correct warning" } |
38 foo (11); | 38 foo (11); |
39 if (a == 0) | 39 if (a == 0) |
40 foo (12); | 40 foo (12); |
41 if (&&lab == 0) // { dg-warning "never be NULL" "correct warning" } | 41 if (&&lab == 0) // { dg-warning "13:the address of .lab. will never be NULL" "correct warning" } |
42 foo (13); | 42 foo (13); |
43 if (0 == foo) // { dg-warning "never be NULL" "correct warning" } | 43 if (0 == foo) // { dg-warning "9:the address of .int foo\\(int\\). will never be NULL" "correct warning" } |
44 foo (14); | 44 foo (14); |
45 if (0 == foo (1)) | 45 if (0 == foo (1)) |
46 foo (15); | 46 foo (15); |
47 if (0 == &i) // { dg-warning "never be NULL" "correct warning" } | 47 if (0 == &i) // { dg-warning "9:the address of .i. will never be NULL" "correct warning" } |
48 foo (16); | 48 foo (16); |
49 if (0 == i) | 49 if (0 == i) |
50 foo (17); | 50 foo (17); |
51 if (0 == &a) // { dg-warning "never be NULL" "correct warning" } | 51 if (0 == &a) // { dg-warning "9:the address of .a. will never be NULL" "correct warning" } |
52 foo (18); | 52 foo (18); |
53 if (0 == a) | 53 if (0 == a) |
54 foo (19); | 54 foo (19); |
55 if (0 == &&lab) // { dg-warning "never be NULL" "correct warning" } | 55 if (0 == &&lab) // { dg-warning "9:the address of .lab. will never be NULL" "correct warning" } |
56 foo (20); | 56 foo (20); |
57 } | 57 } |