blob: 5b7bef5968e16a90b2a47099e57e511a69be03a1 [file] [log] [blame]
#include <stdio.h>
static bool global_ctor_called = false;
struct SideEffectClass {
SideEffectClass() {
global_ctor_called = true;
}
};
static SideEffectClass global{};
int main(int, char**) {
// Regression test for https://github.com/android/ndk/issues/1461. Without the
// fix, the global constructor will not have been called.
if (!global_ctor_called) {
fprintf(stderr, "Global constructor was not called before main\n");
return 1;
}
return 0;
}