111
|
1 /* { dg-lto-do link } */
|
|
2 /* { dg-require-effective-target mpx } */
|
|
3 /* { dg-lto-options { { -flto -flto-partition=max -fcheck-pointer-bounds -mmpx } } } */
|
|
4
|
|
5 const char *cc;
|
|
6
|
|
7 int test1 (const char *c)
|
|
8 {
|
|
9 c = __builtin___bnd_init_ptr_bounds (c);
|
|
10 cc = c;
|
|
11 return c[0] * 2;
|
|
12 }
|
|
13
|
|
14 struct S
|
|
15 {
|
|
16 int (*fnptr) (const char *);
|
|
17 } S;
|
|
18
|
|
19 struct S s1 = {test1};
|
|
20 struct S s2 = {test1};
|
|
21 struct S s3 = {test1};
|
|
22
|
|
23 int main (int argc, const char **argv)
|
|
24 {
|
|
25 return s1.fnptr (argv[0]) + s2.fnptr (argv[1]);
|
|
26 }
|