2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / redecl2.C
blobb654b246582de2d177eee9f42b4cb68334f6976b
1 // { dg-do run  }
2 // GROUPS passed redeclaration
3 // Check that if multiple declarations of the same single
4 // function are present in different places in the same file,
5 // and if these declarations differ (as allowed) in the number
6 // of argument defaults provided, that correct values are
7 // passed at all call points anyway.
9 extern "C" int printf (const char *, ...); 
11 void receiver (int ii, int jj);
13 void sender_1 ()
15         receiver (3,7);
18 void receiver (int ii, int jj = 9);
20 void sender_2 ()
22         receiver (5);
25 int ii_sum = 0;
26 int jj_sum = 0;
28 void sender_3 ();
30 int main ()
32         sender_1 ();
33         sender_2 ();
34         sender_3 ();
35         if (ii_sum != 13 || jj_sum != 25)
36           { printf ("FAIL\n"); return 1; }
37         else
38           printf ("PASS\n");
40         return 0;
43 void receiver (int ii, int jj)
45         ii_sum += ii;
46         jj_sum += jj;
49 void sender_3 ()
51         receiver (5);