gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C
raw| 1 | // PR c++/110057 |
| 2 | /* { dg-do compile } */ |
| 3 | /* Virtual calls should be devirtualized because we know dynamic type of object in array at compile time */ |
| 4 | /* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */ |
| 5 | |
| 6 | class A |
| 7 | { |
| 8 | public: |
| 9 | virtual ~A() |
| 10 | { |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | class B : public A |
| 15 | { |
| 16 | public: |
| 17 | virtual ~B() |
| 18 | { |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | int main() |
| 23 | { |
| 24 | B b[10]; |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | /* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */ |