I have the same problem.
After i have installed mingw 3.1.
I have run your original code without modufication.
Now, the output work fine "Hello, Test"
After i have installed mingw 3.1.
I have run your original code without modufication.
Now, the output work fine "Hello, Test"