[clang] [clang][Driver] Add flag for setting SkipFunctionBodies (PR #100135)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 24 06:46:50 PDT 2024
================
@@ -0,0 +1,13 @@
+// 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'?
----------------
AaronBallman wrote:
Yay for a diagnostic, *boo* for it suggesting `-Xclang` in this instance, but I think we can live with it.
https://github.com/llvm/llvm-project/pull/100135
More information about the cfe-commits
mailing list