[llvm] [llvm-symbolizer] Recognize AIX big archive (PR #150401)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 01:47:31 PST 2025
================
@@ -0,0 +1,25 @@
+// Test archive member recognition by name (ELF format).
+
+// Generate object files from YAML.
+// RUN: yaml2obj -o %t-1.o %S/Inputs/big-archive-elf-1.yaml
+// RUN: yaml2obj -o %t-2.o %S/Inputs/big-archive-elf-2.yaml
+
+// Create archive with differently named members.
+// RUN: rm -f %t.a
+// RUN: llvm-ar crv %t.a %t-1.o %t-2.o
+
+// Test symbolization by member name (using just base names).
+// RUN: llvm-symbolizer --default-arch=ppc64le --obj="%t.a(%{t:stem}.tmp-1.o)" 0x0 | FileCheck %s --check-prefix=CHECK-1
+// RUN: llvm-symbolizer --obj="%t.a(%{t:stem}.tmp-1.o):ppc64le" 0x0 | FileCheck %s --check-prefix=CHECK-1
+// RUN: llvm-symbolizer --default-arch=ppc64le --obj="%t.a(%{t:stem}.tmp-2.o)" 0x0 | FileCheck %s --check-prefix=CHECK-2
+// RUN: llvm-symbolizer --obj="%t.a(%{t:stem}.tmp-2.o):ppc64le" 0x0 | FileCheck %s --check-prefix=CHECK-2
+// CHECK-1: foo1
+// CHECK-2: foo2
+
+// Test error cases.
+// RUN: not llvm-symbolizer --obj="%t.a(nonexistent.o)" 0x1000 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
+// CHECK-ERROR: error: {{.*}}no matching member{{.*}}
----------------
jh7370 wrote:
You can pass the filename is as a FileCheck parameter. This is what we normally do in these cases.
It's important to match the full text, otherwise you might actually be printing complete garbage. For example, your current pattern will match "error: fmkanfjisdngjisdngjidsgno matching memberwehnruiwenirouwenr" which is clearly incorrect.
https://github.com/llvm/llvm-project/pull/150401
More information about the llvm-commits
mailing list