1fb8d02b1SAlp Toker // REQUIRES: x86-registered-target
2*fc018ebbSNick 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 
15fb8d02b1SAlp Toker   // CHECK: warning: stack frame size of {{[0-9]+}} bytes in function 'frameSizeThunkWarning::B::f'
16fb8d02b1SAlp Toker   // CHECK: warning: stack size limit exceeded ({{[0-9]+}}) in {{[^ ]+}}
1713cf19dfSMatt Arsenault   void B::f() {
1813cf19dfSMatt Arsenault     volatile int x = 0; // Ensure there is stack usage.
1913cf19dfSMatt Arsenault   }
20fb8d02b1SAlp Toker }
21