1673dc3d4SNico Weber // Constexpr:
2673dc3d4SNico Weber // We need to check that a global variable initialized with a constexpr
3673dc3d4SNico Weber // constructor can be accessed during dynamic initialization (as a constexpr
4673dc3d4SNico Weber // constructor implies that it was initialized during constant initialization,
5673dc3d4SNico Weber // not dynamic initialization).
6673dc3d4SNico Weber 
7673dc3d4SNico Weber // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
8673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
9673dc3d4SNico Weber // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
10673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
11673dc3d4SNico Weber // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
12673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
13673dc3d4SNico Weber // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
14673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
15673dc3d4SNico Weber 
16673dc3d4SNico Weber class Integer {
17673dc3d4SNico Weber private:
18673dc3d4SNico Weber   int value;
19673dc3d4SNico Weber 
20673dc3d4SNico Weber public:
Integer(int x=0)21*48eb4a27SVitaly Buka   explicit constexpr Integer(int x = 0) : value(x) {}
getValue()22673dc3d4SNico Weber   int getValue() {return value;}
23673dc3d4SNico Weber };
24673dc3d4SNico Weber Integer coolestInteger(42);
getCoolestInteger()25673dc3d4SNico Weber int getCoolestInteger() { return coolestInteger.getValue(); }
26673dc3d4SNico Weber 
main()27673dc3d4SNico Weber int main() { return 0; }
28