1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-sra -fdump-tree-optimized-slim" } */
4 /* This emulates what C++ trstcase pr110378-1.C looks like on 32-bit arm (or
5 any architecture where the destructor returns this pointer. It verifies
6 that when it later becomes known that the return value will be removed, we
7 can split a parameter even in this case. */
11 short move_offset_of_a
;
15 extern int *allocate_stuff (unsigned);
16 extern void deallocate_stuff (void *);
19 something_like_a_constructor (struct S
*p
, int len
)
21 p
->a
= allocate_stuff (len
* sizeof (int));
26 operation (struct S
*p
)
31 static struct S
* __attribute__((noinline
))
32 something_like_an_arm32_destructor (struct S
*p
)
34 deallocate_stuff (p
->a
);
42 struct S shouldnotexist
;
43 something_like_a_constructor (&shouldnotexist
, v2
);
44 v2
= operation (&shouldnotexist
);
45 something_like_an_arm32_destructor (&shouldnotexist
);
49 /* { dg-final { scan-ipa-dump "Will split parameter 0" "sra" } } */
50 /* { dg-final { scan-tree-dump-not "shouldnotexist" "optimized" } } */