ld: Update function prototypes for compilers defaulting to -std=gnu23
[binutils-gdb.git] / ld / testsuite / ld-x86-64 / protected-data-1b.c
bloba4756ee08da5aaf741663b80d8aa2ab52bd50c60
1 #include <stdio.h>
3 #include "protected-data-1.h"
5 int protected_data_1b = 3;
7 int
8 main (void)
10 int res = 0;
12 /* Check if we get the same address for the protected data symbol. */
13 if (&protected_data_1a != protected_data_1a_p ())
15 puts ("'protected_data_1a' in main and shared library doesn't have same address");
16 res = 1;
19 protected_data_1a = -1;
20 if (check_protected_data_1a (-1))
22 puts ("'protected_data_1a' in main and shared library doesn't have same value");
23 res = 1;
26 set_protected_data_1a (-3);
27 if (protected_data_1a != -3)
29 puts ("'protected_data_1a' in main and shared library doesn't have same value");
30 res = 1;
33 /* Check if we get the different addresses for the protected data
34 symbol. */
35 if (&protected_data_1b == protected_data_1b_p ())
37 puts ("'protected_data_1b' in main and shared library has same address");
38 res = 1;
41 protected_data_1b = -10;
42 if (check_protected_data_1b (2))
44 puts ("'protected_data_1b' in main and shared library has same address");
45 res = 1;
48 set_protected_data_1b (-30);
49 if (protected_data_1b != -10)
51 puts ("'protected_data_1b' in main and shared library has same address");
52 res = 1;
55 if (!res)
56 puts ("PASS");
58 return res;