Reid Kleckner | ce5173c | 2020-03-19 11:52:22 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s -triple=i686-windows-msvc -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | // When generating thunks using musttail due to inalloca parameters, don't push |
| 4 | // and pop terminate scopes. PR44987 |
| 5 | |
| 6 | struct NonTrivial { |
| 7 | NonTrivial(); |
| 8 | NonTrivial(const NonTrivial &o); |
| 9 | ~NonTrivial(); |
| 10 | int x; |
| 11 | }; |
| 12 | struct A { |
| 13 | virtual void f(NonTrivial o) noexcept; |
| 14 | }; |
| 15 | struct B { |
| 16 | virtual void f(NonTrivial o) noexcept; |
| 17 | }; |
| 18 | class C : A, B { |
| 19 | virtual void f(NonTrivial o) noexcept; |
| 20 | }; |
| 21 | C c; |
| 22 | |
| 23 | // CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@C@@G3AEXUNonTrivial@@@Z"(%class.C* %this, <{ %struct.NonTrivial }>* inalloca %0) |
| 24 | // CHECK-NOT: invoke |
| 25 | // CHECK: musttail call x86_thiscallcc void @"?f@C@@EAEXUNonTrivial@@@Z"(%class.C* %{{.*}}, <{ %struct.NonTrivial }>* inalloca %0) |
Jon Roelofs | 38b39c3 | 2020-04-14 10:46:21 -0600 | [diff] [blame] | 26 | // CHECK-NEXT: ret void |
Reid Kleckner | ce5173c | 2020-03-19 11:52:22 -0700 | [diff] [blame] | 27 | |