Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/volatile2.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do compile } */ |
2 /* { dg-options "-O2 -fdump-tree-optimized" } */ | |
3 | |
4 struct GTeth_desc | |
5 { | |
6 unsigned ed_cmdsts; | |
7 }; | |
8 struct GTeth_softc | |
9 { | |
10 struct GTeth_desc txq_desc[32]; | |
11 }; | |
12 | |
13 void foo(struct GTeth_softc *sc) | |
14 { | |
15 /* Verify that we retain the volatileness on the | |
16 store until after optimization. */ | |
17 volatile struct GTeth_desc *p = &sc->txq_desc[0]; | |
18 p->ed_cmdsts = 0; | |
19 } | |
20 | |
21 /* { dg-final { scan-tree-dump "{v}" "optimized" } } */ |