Document gcov-io (PR gcov-profile/84735).
[official-gcc.git] / gcc / testsuite / gcc.dg / pragma-init-fini.c
blob4013b8dd094b683c5c2c82c04028301abbab84cc
1 /* Tests for #pragma init and #pragma fini. */
3 /* { dg-do run { target *-*-solaris2.* } } */
5 extern void abort ();
7 #pragma init /* { dg-warning "malformed" } */
8 #pragma init () /* { dg-warning "malformed" } */
9 #pragma init init_func /* { dg-warning "malformed" } */
11 #pragma fini /* { dg-warning "malformed" } */
12 #pragma fini () /* { dg-warning "malformed" } */
13 #pragma fini fini_func /* { dg-warning "malformed" } */
15 #pragma init (init_func, init_static_func)
17 int glob_1, glob_2;
19 void init_func (void)
21 glob_1 = 1;
24 static void init_static_func (void)
26 glob_2 = 2;
29 #pragma fini (fini_func, fini_static_func)
31 void fini_func (void)
36 static void fini_static_func (void)
41 int main()
43 if (glob_1 != 1)
44 abort ();
46 if (glob_2 != 2)
47 abort ();
49 return 0;