gcc/testsuite/g++.dg/tree-ssa/volatile1.C
raw| 1 | // PR c++/84151 |
| 2 | // { dg-additional-options "-fdump-tree-gimple" } |
| 3 | // { dg-final { scan-tree-dump-not {\*this} "gimple" } } |
| 4 | |
| 5 | struct A { |
| 6 | static int& bar(int& a) { |
| 7 | return a; |
| 8 | } |
| 9 | static int i; |
| 10 | |
| 11 | int foo() volatile { |
| 12 | int v = c; |
| 13 | return i + bar(v); |
| 14 | } |
| 15 | |
| 16 | int c; |
| 17 | }; |
| 18 | |
| 19 | int A::i = 0; |
| 20 | |
| 21 | A a; |
| 22 | |
| 23 | int main() { |
| 24 | a.c = 2; |
| 25 | a.foo(); |
| 26 | |
| 27 | return 0; |
| 28 | } |