[clang] [Clang][NFC] Fix a test failure with mold linker (PR #122587)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 11 01:09:09 PST 2025


https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/122587

Mold prefers the suffix '$' for symbols like PLT and GOT entries, so exclude these symbols as well. Otherwise, this test will fail for developers using mold-linked Clang.


>From 19467fe0e48abfe85003ebf80e29a37da853f4e0 Mon Sep 17 00:00:00 2001
From: Younan Zhang <zyn7109 at gmail.com>
Date: Sat, 11 Jan 2025 17:01:16 +0800
Subject: [PATCH] [Clang][NFC] Fix a test failure with mold linker

Mold prefers the suffix '$' for symbols like PLT and GOT entries,
so exclude these symbols as well. Otherwise, this test will fail
for developers using mold-linked Clang
---
 clang/test/LibClang/symbols.test | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/LibClang/symbols.test b/clang/test/LibClang/symbols.test
index fd2ff8bc6cd423..e12b4c9991b811 100644
--- a/clang/test/LibClang/symbols.test
+++ b/clang/test/LibClang/symbols.test
@@ -1,6 +1,6 @@
 # Check that there are no unversioned clang symbols in libclang.so
 RUN: llvm-nm -Dj --defined-only %libclang | grep -v -e '@@LLVM_[0-9]\+$' | not grep '^clang'
 
-# Check that here are no local clang_ symbols (ignoring symbols with .cold or
+# Check that there are no local clang_ symbols (ignoring symbols with .cold or
 # .localalias suffxies.)
-RUN: llvm-nm %libclang | not grep '[a-z] clang_[^.]\+$'
+RUN: llvm-nm %libclang | not grep '[a-z] clang_[^.$]\+$'



More information about the cfe-commits mailing list