1 /* Verify that gimple-level NRV is occurring when values other than the
2 return slot are call-clobbered. */
3 /* { dg-do compile } */
4 /* { dg-options "-O -fdump-tree-optimized" } */
6 typedef struct { int x
[20]; void *y
; } S
;
7 typedef struct { int a
; S b
; } T
;
8 S
nrv_candidate (void);
9 void use_result (S
, int);
20 /* i is call-clobbered for these calls, but result and result_arr
22 result
= nrv_candidate ();
23 result_arr
[3][4].b
= nrv_candidate ();
25 use_result (result
, i
);
26 use_result (result_arr
[3][4].b
, i
);
29 /* { dg-final { scan-tree-dump-times "return slot optimization" 2 "optimized" } } */