]>
Commit | Line | Data |
---|---|---|
8dc19053 ML |
1 | /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */ |
2 | /* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */ | |
3 | ||
4 | struct Foo | |
5 | { | |
6 | Foo() : a(1), b(1), c('a') {} | |
7 | int a; | |
8 | int b; | |
9 | char c; | |
10 | }; | |
11 | ||
12 | static Foo copy_foo(Foo) __attribute__((noinline, noclone)); | |
13 | ||
14 | static Foo copy_foo(Foo A) | |
15 | { | |
16 | return A; | |
17 | } | |
18 | ||
19 | struct Bar : Foo | |
20 | { | |
21 | Bar(Foo t) : Foo(copy_foo(t)) {} | |
22 | }; | |
23 | ||
24 | Foo F; | |
25 | ||
26 | int main (void) | |
27 | { | |
28 | Bar B (F); | |
29 | ||
30 | if (B.a != 1 || B.b != 1 || B.c != 'a') | |
31 | __builtin_abort (); | |
32 | ||
33 | return 0; | |
34 | } |