gcc/testsuite/g++.dg/tree-ssa/pr13954.C
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O1 -fdump-tree-optimized" } */ |
| 3 | |
| 4 | void link_error (void); |
| 5 | |
| 6 | class base |
| 7 | { |
| 8 | }; |
| 9 | |
| 10 | class teststruct: public base |
| 11 | { |
| 12 | public: |
| 13 | double d; |
| 14 | char f1; |
| 15 | }; |
| 16 | |
| 17 | void |
| 18 | copystruct1 (teststruct param) |
| 19 | { |
| 20 | teststruct local; |
| 21 | param.f1 = 0; |
| 22 | local = param; |
| 23 | if (local.f1 != 0) |
| 24 | link_error (); |
| 25 | } |
| 26 | |
| 27 | /* There should be no reference to link_error. */ |
| 28 | /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */ |