1fb8d02b1SAlp Toker // REQUIRES: x86-registered-target
2fc018ebbSNick Desaulniers // RUN: %clang_cc1 %s -fwarn-stack-size=0 -emit-codegen-only -triple=i386-apple-darwin 2>&1 | FileCheck %s
3fb8d02b1SAlp Toker 
4fb8d02b1SAlp Toker // TODO: Emit rich diagnostics for thunks and move this into the appropriate test file.
5fb8d02b1SAlp Toker // Until then, test that we fall back and display the LLVM backend diagnostic.
6fb8d02b1SAlp Toker namespace frameSizeThunkWarning {
7fb8d02b1SAlp Toker   struct A {
8fb8d02b1SAlp Toker     virtual void f();
9fb8d02b1SAlp Toker   };
10fb8d02b1SAlp Toker 
11fb8d02b1SAlp Toker   struct B : virtual A {
12fb8d02b1SAlp Toker     virtual void f();
13fb8d02b1SAlp Toker   };
14fb8d02b1SAlp Toker 
15*25682868SArthur Eubanks   // CHECK: warning: stack frame size ([[#]]) exceeds limit ([[#]]) in 'frameSizeThunkWarning::B::f()'
16e4223438SArthur Eubanks   // CHECK: warning: stack frame size ([[#]]) exceeds limit ([[#]]) in function '_ZTv0_n12_N21frameSizeThunkWarning1B1fEv'
f()1713cf19dfSMatt Arsenault   void B::f() {
1813cf19dfSMatt Arsenault     volatile int x = 0; // Ensure there is stack usage.
1913cf19dfSMatt Arsenault   }
20fb8d02b1SAlp Toker }
21