* contrib: Remove directory.
[binutils.git] / ld / testsuite / ld-sh / sh2.c
blob527fe88ce5d5f09d22f53093a8bb0f9e64132dff
1 int global;
3 extern void trap (int, int);
4 static void quit (int);
5 static int foo (int);
7 int
8 main ()
10 if (foo (0) != 0 || global != 0)
11 quit (1);
12 if (foo (1) != 1 || global != 1)
13 quit (1);
14 if (foo (2) != 2 || global != 2)
15 quit (1);
16 if (foo (3) != 3 || global != 3)
17 quit (1);
18 if (foo (4) != 4 || global != 4)
19 quit (1);
20 if (foo (5) != 5 || global != 5)
21 quit (1);
22 if (foo (6) != 6 || global != 6)
23 quit (1);
24 if (foo (7) != 7 || global != 7)
25 quit (1);
26 if (foo (8) != 8 || global != 8)
27 quit (1);
28 quit (0);
31 void
32 __main ()
36 static void
37 quit (int status)
39 trap (1, status);
42 int
43 bar (int i)
45 global = i;
46 return i;
49 int
50 bar0 (int i)
52 global = 0;
53 return i;
56 int
57 bar1 (int i)
59 global = 1;
60 return i;
63 int
64 bar2 (int i)
66 global = 2;
67 return i;
70 int
71 bar3 (int i)
73 global = 3;
74 return i;
77 int
78 bar4 (int i)
80 global = 4;
81 return i;
84 int
85 bar5 (int i)
87 global = 5;
88 return i;
91 int
92 bar6 (int i)
94 global = 6;
95 return i;
98 int
99 bar7 (int i)
101 global = 7;
102 return i;
106 foo (int i)
108 switch (i)
110 case 0: bar0 (0); return 0;
111 case 1: bar1 (1); return 1;
112 case 2: bar2 (2); return 2;
113 case 3: bar3 (3); return 3;
114 case 4: bar4 (4); return 4;
115 case 5: bar5 (5); return 5;
116 case 6: bar6 (6); return 6;
117 case 7: bar7 (7); return 7;
118 default: return bar (i);