| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include <iostream> |
| 10 | |
| 11 | // FIXME: Remove after issue https://github.com/llvm/llvm-project/issues/127348 resolved. |
| 12 | extern "C" const char* __asan_default_options() { return "check_initialization_order=true:strict_init_order=true" ; } |
| 13 | |
| 14 | // Test that ios used from globals constructors doesn't trigger Asan initialization-order-fiasco. |
| 15 | |
| 16 | struct Global { |
| 17 | Global() { std::cout << "Hello!" ; } |
| 18 | } global; |
| 19 | |
| 20 | int main(int, char**) { return 0; } |
| 21 | |