1*fb8d02b1SAlp Toker // REQUIRES: x86-registered-target
2*fb8d02b1SAlp Toker // RUN: %clang_cc1 %s -mllvm -warn-stack-size=0 -emit-codegen-only -triple=i386-apple-darwin 2>&1 | FileCheck %s
3*fb8d02b1SAlp Toker 
4*fb8d02b1SAlp Toker // TODO: Emit rich diagnostics for thunks and move this into the appropriate test file.
5*fb8d02b1SAlp Toker // Until then, test that we fall back and display the LLVM backend diagnostic.
6*fb8d02b1SAlp Toker namespace frameSizeThunkWarning {
7*fb8d02b1SAlp Toker   struct A {
8*fb8d02b1SAlp Toker     virtual void f();
9*fb8d02b1SAlp Toker   };
10*fb8d02b1SAlp Toker 
11*fb8d02b1SAlp Toker   struct B : virtual A {
12*fb8d02b1SAlp Toker     virtual void f();
13*fb8d02b1SAlp Toker   };
14*fb8d02b1SAlp Toker 
15*fb8d02b1SAlp Toker   // CHECK: warning: stack frame size of {{[0-9]+}} bytes in function 'frameSizeThunkWarning::B::f'
16*fb8d02b1SAlp Toker   // CHECK: warning: stack size limit exceeded ({{[0-9]+}}) in {{[^ ]+}}
17*fb8d02b1SAlp Toker   void B::f() { }
18*fb8d02b1SAlp Toker }
19