Initialize Tizen 2.3
[external/prelink.git] / testsuite / reloc7.c
1 #include "reloc1.h"
2 #include <stdlib.h>
3 #include <stdio.h>
4
5 int i;
6 int j __attribute__((aligned (32)));
7 int k[2048];
8 int l = 26;
9 int m[3] = { 28, 29, 30 };
10 extern int baz[3];
11
12 struct A n __attribute__((section("nsec"))) = { 1, &n, &m[2] };
13 static struct A o __attribute__((section("osec"))) = { 2, &o, &baz[1] };
14
15 void f5 (FILE *f)
16 {
17   fprintf (stdout, "OK");
18 }
19
20 int main()
21 {
22   struct A *x;
23   foo.c -= 2;
24   if (foo.a != 1 || foo.b != &foo || foo.c[0] != 28 || foo.c[1] != 29
25       || foo.c[2] != 30)
26     abort ();
27   if (f1 () != 11 || f2 () != 12)
28     abort ();
29   x = f3 ();
30   if (x->a != 2 || x->b != x || x->c != foo.c + 1)
31     abort ();
32   if (n.a != 1 || n.b != &n || n.c != m + 2)
33     abort ();
34   if (o.a != 2 || o.b != &o || o.c != baz + 1)
35     abort ();
36   f5 (stdout);
37   exit (0);
38 }