test for unorderd init

This commit is contained in:
MITSUNARI Shigeo 2012-12-04 16:12:59 +09:00
parent be5d47c144
commit a57fdb0f10
4 changed files with 35 additions and 2 deletions

View file

@ -1,5 +1,9 @@
#include <stdio.h>
static const struct XXX {
XXX() { puts("XXX"); }
} s_sss;
struct A {
int aaa;
A()
@ -35,9 +39,13 @@ static struct Init {
}
} s_init;
int f() { puts("f"); return 4; }
static const int r = f();
int main()
{
puts("main");
printf("r=%d\n", r);
X::sss.put();
}