[clang] [Test][clang-repl]Keep value names in clang-repl pragma-optimize.cpp (PR #235305)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 07:39:47 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jinsong Ji (jsji)

<details>
<summary>Changes</summary>

The test added by aa6e40c073e6 checks for named values
(entry:, %x.addr, %x), which only appear when clang keeps value names.
That is the default in assertion builds, but non-assertion CI builds
discard them, so the CHECK-NEXT: entry: line fails. Pass
-fno-discard-value-names explicitly.

Assisted-By: Claude Opus 5.5


---
Full diff: https://github.com/llvm/llvm-project/pull/235305.diff


1 Files Affected:

- (modified) clang/test/Interpreter/pragma-optimize.cpp (+2-1) 


``````````diff
diff --git a/clang/test/Interpreter/pragma-optimize.cpp b/clang/test/Interpreter/pragma-optimize.cpp
index 1d43c54e8edb42..580901117da51a 100644
--- a/clang/test/Interpreter/pragma-optimize.cpp
+++ b/clang/test/Interpreter/pragma-optimize.cpp
@@ -3,7 +3,8 @@
 // '#pragma clang repl optimize(<opt>)' sets the optimization level and size for
 // input parsed after it; <opt> is an -O flag spelled without the leading dash.
 //
-// RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -emit-llvm | FileCheck %s
+// RUN: cat %s | clang-repl -Xcc -fno-discard-value-names -Xcc -Xclang -Xcc -emit-llvm \
+// RUN:   | FileCheck %s
 
 extern "C" int f_o0(int x) { return x; }
 // CHECK:      ; Function Attrs: {{.*}}noinline {{.*}}optnone

``````````

</details>


https://github.com/llvm/llvm-project/pull/235305


More information about the cfe-commits mailing list