1 // REQUIRES: x86-registered-target
2 // RUN: %clang -target i386-apple-darwin -std=c++11 -fblocks -Wframe-larger-than=70 -Wno-stdlibcxx-not-found -Xclang -verify -o /dev/null -c %s
3 // RUN: %clang -target i386-apple-darwin -std=c++11 -fblocks -Wframe-larger-than=70 -Wno-stdlibcxx-not-found -Xclang -verify -o /dev/null -c %s -DIS_SYSHEADER
6 // * The driver passes the option through to the backend.
7 // * The frontend diagnostic handler 'demangles' and resolves the correct function definition.
9 // Test that link invocations don't emit an "argument unused during compilation" diagnostic.
11 // RUN: %clang -Werror -Wno-msvc-not-found -Wno-liblto -Wframe-larger-than=0 %t.o -### 2>&1 | not grep ' error: '
13 // TODO: Support rich backend diagnostics for Objective-C methods.
15 // Backend diagnostics aren't suppressed in system headers because such results
16 // are significant and actionable.
20 #pragma clang system_header
23 extern void doIt(char *);
25 void frameSizeWarning(int, int) {}
27 void frameSizeWarning();
29 void frameSizeWarning() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeWarning'}}
34 void frameSizeWarning();
36 void frameSizeWarning(int) {}
38 #pragma GCC diagnostic push
39 #pragma GCC diagnostic ignored "-Wframe-larger-than="
40 void frameSizeWarningIgnored() {
44 #pragma GCC diagnostic pop
46 #pragma GCC diagnostic push
48 // expected-warning@+2 {{unknown warning group '-Wframe-larger-than'}}
50 #pragma GCC diagnostic ignored "-Wframe-larger-than"
51 #pragma GCC diagnostic pop
53 void frameSizeLocalClassWarning() {
55 S() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeLocalClassWarning()::S::S'}}
63 void frameSizeLambdaWarning() {
65 []() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in lambda expression}}
72 void frameSizeBlocksWarning() {
74 ^() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in block literal}}