diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2018-06-29 14:24:58 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2018-08-24 15:51:39 +0200 |
commit | 97d2c44332e73df730673555f76a403968676d8c (patch) | |
tree | ac4287c920b85d6ab085ba747a4855dc34c13766 /testsuites | |
parent | psxfile01: floating point context required when calling fprintf (diff) | |
download | rtems-97d2c44332e73df730673555f76a403968676d8c.tar.bz2 |
spglobalcon01: LLVM optimization makes variable i always 1
Declare i volatile to avoid compiler optimization putting i
into data section with initialization value 1.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/spglobalcon01/init.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuites/sptests/spglobalcon01/init.cc b/testsuites/sptests/spglobalcon01/init.cc index aee9d0a141..f31ceca7df 100644 --- a/testsuites/sptests/spglobalcon01/init.cc +++ b/testsuites/sptests/spglobalcon01/init.cc @@ -27,10 +27,10 @@ class A { ++i; } - static int i; + static volatile int i; }; -int A::i; +volatile int A::i; static A a; |