[clang] [llvm] [clang] Support multiple in-process cc1 jobs in a ToolSession (PR #222531)
Anutosh Bhat via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 02:15:49 PDT 2026
================
@@ -0,0 +1,36 @@
+// REQUIRES: llvm-driver, webassembly-registered-target
+
+// A Clang invocation owned by ToolSession can execute multiple cc1 jobs
+// in-process. Each job must free its CompilerInstance before returning.
+// RUN: split-file %s %t
+// RUN: cd %t && %clang --target=wasm32-unknown-unknown -c -### \
+// RUN: first.c second.c 2>&1 \
+// RUN: | FileCheck %s --check-prefix=COMMANDS \
+// RUN: --implicit-check-not='"-disable-free"'
+// COMMANDS-COUNT-2: (in-process)
+
+// The same cleanup rule applies to a single cc1 job because the session stays
+// alive after the top-level Clang invocation returns.
+// RUN: cd %t && %clang --target=wasm32-unknown-unknown -c -### first.c 2>&1 \
+// RUN: | FileCheck %s --check-prefix=SINGLE \
+// RUN: --implicit-check-not='"-disable-free"'
+// SINGLE: (in-process)
+
+// An explicit request for a separate cc1 process remains authoritative.
+// RUN: cd %t && %clang --target=wasm32-unknown-unknown \
+// RUN: -fno-integrated-cc1 -c -### first.c second.c 2>&1 \
----------------
anutosh491 wrote:
Done.
https://github.com/llvm/llvm-project/pull/222531
More information about the llvm-commits
mailing list