summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/const6.C
blob: 1a5c79bb173e73b8f47af9d5576cddb270fa76ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR target/39179
// Make sure that we don't optimize away the load from K::k.
// { dg-options "-O2" }
// { dg-final { scan-assembler _ZN1K1kE } }

struct K {
    static const unsigned k;
};
extern "C" void abort (void);
int main() {
    if ( K::k != 1 )
      abort ();
    return 1;
}