[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:34 PST 2025
================
@@ -0,0 +1,33 @@
+// Test big archive recognition and error handling in llvm-symbolizer.
+
+// Generate object files.
+// RUN: yaml2obj -o %t-32.o %S/Inputs/big-archive-32.yaml
+// RUN: yaml2obj -o %t-64.o %S/Inputs/big-archive-64.yaml
+
+// Create archive with same-named members using different modes.
+// RUN: rm -f %t.a
+// RUN: cp %t-32.o %t.o
+// RUN: llvm-ar %if system-aix %{-X32%} crv %t.a %t.o
+// RUN: cp %t-64.o %t.o
+// RUN: llvm-ar %if system-aix %{-X64 rv%} %else %{qv%} %t.a %t.o
+
+// Verify archive contains two members with same name.
+// RUN: llvm-ar tv %if system-aix %{-X32_64%} %t.a | FileCheck %s --check-prefix=CHECK-ARCHIVE
+// CHECK-ARCHIVE: {{.*}}symbolize-big-archive-xcoff.test.tmp.o{{$}}
+// CHECK-ARCHIVE: {{.*}}symbolize-big-archive-xcoff.test.tmp.o{{$}}
+
+// Test successful symbolization.
+// RUN: llvm-symbolizer --default-arch=ppc --obj="%t.a(%{t:stem}.tmp.o)" 0x0 | FileCheck %s --check-prefix=CHECK-32
+// RUN: llvm-symbolizer --default-arch=ppc64 --obj="%t.a(%{t:stem}.tmp.o)" 0x0 | FileCheck %s --check-prefix=CHECK-64
+// RUN: llvm-symbolizer --obj="%t.a(%{t:stem}.tmp.o):ppc" 0x0 | FileCheck %s --check-prefix=CHECK-32
+// RUN: llvm-symbolizer --obj="%t.a(%{t:stem}.tmp.o):ppc64" 0x0 | FileCheck %s --check-prefix=CHECK-64
+// CHECK-32: foo
+// CHECK-64: foo
+
+// 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{{.*}}
+// RUN: not llvm-symbolizer --obj="%t.o(%{t:stem}.tmp.o)" 0x1000 2>&1 | FileCheck %s --check-prefix=CHECK-NOTARCHIVE
----------------
jh7370 wrote:
> this is a more cosmetic change rather than functional
Cosmetics improve readability and therefore maintainability.
> The tests work as expected
This is irrelevant (see my previous point).
> and it is inline with lot of other lit tests as well
The idea of cd-ing into another directory is relatively new, but there are a other tests that have adopted it among newer tests.
My big concern is that the use of `%t.o(%{t:stem}.tmp.o)` is not especially readable, whereas something like `1.o(2.o)` or whatever is much more readable. By making this style of change throughout the test, it'll become a lot clearer what is going on.
https://github.com/llvm/llvm-project/pull/150401
More information about the llvm-commits
mailing list