1*673dc3d4SNico Weber // Constexpr: 2*673dc3d4SNico Weber // We need to check that a global variable initialized with a constexpr 3*673dc3d4SNico Weber // constructor can be accessed during dynamic initialization (as a constexpr 4*673dc3d4SNico Weber // constructor implies that it was initialized during constant initialization, 5*673dc3d4SNico Weber // not dynamic initialization). 6*673dc3d4SNico Weber 7*673dc3d4SNico Weber // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t 8*673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 9*673dc3d4SNico Weber // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t 10*673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 11*673dc3d4SNico Weber // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t 12*673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 13*673dc3d4SNico Weber // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t 14*673dc3d4SNico Weber // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 15*673dc3d4SNico Weber 16*673dc3d4SNico Weber class Integer { 17*673dc3d4SNico Weber private: 18*673dc3d4SNico Weber int value; 19*673dc3d4SNico Weber 20*673dc3d4SNico Weber public: 21*673dc3d4SNico Weber constexpr Integer(int x = 0) : value(x) {} 22*673dc3d4SNico Weber int getValue() {return value;} 23*673dc3d4SNico Weber }; 24*673dc3d4SNico Weber Integer coolestInteger(42); 25*673dc3d4SNico Weber int getCoolestInteger() { return coolestInteger.getValue(); } 26*673dc3d4SNico Weber 27*673dc3d4SNico Weber int main() { return 0; } 28