gas:
[binutils/dougsmingw.git] / ld / testsuite / ld-cygwin / testexe.c
blob50a980beca9be02bf57643b04db0c822963c985e
1 int global_a = 2;
3 void
4 exewrite (void)
6 global_a = 1;
9 extern void dllwrite (void);
11 int _stdcall
12 testexe_main (void* p1, void *p2, char* p3, int p4)
14 dllwrite ();
15 /* We can't print or assert in a minimal app like this,
16 so use the return status to indicate if global_a
17 ended up with the correct expected value. */
18 return 1 - global_a;
21 /* We have to import something, anything at all, from
22 kernel32, in order to have the thread and process
23 base thunk routines loaded when we start running!. */
24 extern __attribute((dllimport)) void _stdcall Sleep (unsigned int duration);
26 int _stdcall
27 testexe_dummy (unsigned int foobar)
29 Sleep (foobar);