llvm-project/clang/test/CodeGen/inline-stacksize.c
Wolfgang Pieb 8564e2fea5 [Inlining] Add a clang option to limit inlining of functions
Add the clang option -finline-max-stacksize=<N> to suppress inlining
of functions whose stack size exceeds the given value.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D131986
2022-08-18 11:56:24 -07:00

9 lines
358 B
C

// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | FileCheck %s --check-prefixes NOOPT
// RUN: %clang_cc1 -O2 -finline-max-stacksize=64 -emit-llvm %s -o - | FileCheck %s --check-prefix OPT
void foo() {}
// NOOPT-NOT: inline-max-stacksize
// OPT: define {{.*}}@foo{{.*}}#[[ATTR:[0-9]+]]
// OPT: attributes #[[ATTR]] = {{.*}}"inline-max-stacksize"="64"