gcc/testsuite/c-c++-common/analyzer/volatile-1.c
raw| 1 | #include "../../gcc.dg/analyzer/analyzer-decls.h" |
| 2 | |
| 3 | volatile int g; |
| 4 | |
| 5 | void test_global (void) |
| 6 | { |
| 7 | int v1 = g; |
| 8 | int v2 = g; |
| 9 | __analyzer_eval (v1 == v2); /* { dg-warning "UNKNOWN" } */ |
| 10 | } |
| 11 | |
| 12 | void test_local (void) |
| 13 | { |
| 14 | volatile int x = 0; |
| 15 | int v1 = x; |
| 16 | int v2 = x; |
| 17 | __analyzer_eval (v1 == v2); /* { dg-warning "UNKNOWN" } */ |
| 18 | } |