llvm-project/clang/test/Frontend/skip-function-bodies.cpp
kadir çetinkaya 456c5121f8
[clang][Driver] Add cc1 flag for setting SkipFunctionBodies (#100135)
This is an option set by certain tools (clangd and ASTUnit). Sometimes
there are crashes in clang, unique to this configuration and it's really
hard to provide reproducers without invoking the tool.
2024-07-25 11:27:14 +02:00

14 lines
487 B
C++

// Trivial check to ensure skip-function-bodies flag is propagated.
//
// RUN: %clang_cc1 -verify -skip-function-bodies -pedantic-errors %s
// expected-no-diagnostics
int f() {
// normally this should emit some diags, but we're skipping it!
this is garbage;
}
// Make sure we only accept it as a cc1 arg.
// RUN: not %clang -skip-function-bodies %s 2>&1 | FileCheck %s
// CHECK: clang: error: unknown argument '-skip-function-bodies'; did you mean '-Xclang -skip-function-bodies'?