| 1 |
// Test the warn-stack-size function attribute is not generated when -Wframe-larger-than is ignored |
| 2 |
// through pragma. |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -fwarn-stack-size=70 -emit-llvm -o - %s | FileCheck %s |
| 5 |
// CHECK: "warn-stack-size"="70" |
| 6 |
|
| 7 |
// RUN: %clang_cc1 -DIGNORED -fwarn-stack-size=70 -emit-llvm -o - %s | FileCheck %s --check-prefix=IGNORED |
| 8 |
// IGNORED-NOT: "warn-stack-size"="70" |
| 9 |
|
| 10 |
extern void doIt(char *); |
| 11 |
|
| 12 |
#ifdef IGNORED |
| 13 |
#pragma GCC diagnostic push |
| 14 |
#pragma GCC diagnostic ignored "-Wframe-larger-than" |
| 15 |
#endif |
| 16 |
|
| 17 |
void frameSizeAttr() { |
| 18 |
char buffer[80]; |
| 19 |
doIt(buffer); |
| 20 |
} |
| 21 |
|
| 22 |
#ifdef IGNORED |
| 23 |
#pragma GCC diagnostic pop |
| 24 |
#endif |