]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/native-link-modifier-whole-archive/c_static_lib_with_constructor.cpp
Rollup merge of #99835 - TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern...
[rust.git] / src / test / run-make / native-link-modifier-whole-archive / c_static_lib_with_constructor.cpp
1 #include <cstdio>
2
3 // Since this is a global variable, its constructor will be called before
4 // main() is executed. But only if the object file containing it actually
5 // gets linked into the executable.
6 struct Foo {
7     Foo() {
8         printf("static-initializer.");
9         fflush(stdout);
10     }
11 } FOO;