Skip to content

Commit baed235

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
1 parent be98428 commit baed235

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
extern "C" const char *__asan_default_options() {
12+
return "check_initialization_order=true:strict_init_order=true";
13+
}
14+
15+
// Test that ios used from globals constructors doesn't trigger
16+
// Asan initialization-order-fiasco.
17+
18+
struct Global {
19+
Global() {
20+
std::cout << "Hello!";
21+
}
22+
} global;
23+
24+
int main(int, char**)
25+
{
26+
return 0;
27+
}

0 commit comments

Comments
 (0)