brintos

brintos / llvm-project-archived public Read only

0
0
Text · 616 B · c7d8a23 Raw
25 lines · cpp
1// Test the warn-stack-size function attribute is not generated when -Wframe-larger-than is ignored2// through pragma.3 4// RUN: %clang_cc1 -fwarn-stack-size=70 -emit-llvm -o - %s | FileCheck %s5// CHECK: "warn-stack-size"="70"6 7// RUN: %clang_cc1 -DIGNORED -fwarn-stack-size=70 -emit-llvm -o - %s | FileCheck %s --check-prefix=IGNORED8// IGNORED-NOT: "warn-stack-size"="70"9 10extern void doIt(char *);11 12#ifdef IGNORED13#pragma GCC diagnostic push14#pragma GCC diagnostic ignored "-Wframe-larger-than"15#endif16 17void frameSizeAttr() {18  char buffer[80];19  doIt(buffer);20}21 22#ifdef IGNORED23#pragma GCC diagnostic pop24#endif25