================
@@ -1120,3 +1120,19 @@
// RUN: -c \
// RUN: | FileCheck --check-prefixes=CHECK-K-UNUSED %s
// CHECK-K-UNUSED: clang: warning: -K: 'linker' input unused
[-Wunused-command-line-argument]
+
+// Check No Sanitizer on 32-bit AIX
+// RUN: %clang -target powerpc-ibm-aix -m32 %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LD32-NO-SANITIZER %s
+// CHECK-LD32-NO-SANITIZER-NOT: "-latomic"
+
+// This test verifies that the linker doesn't include '-latomic' when no
sanitizers are enabled
+// FIXME: Running this test on non-AIX host will result in the following error:
+// LLVM ERROR: Sanitizer interface functions must be exported by export files
on AIX
+
+// Check enable AddressSanitizer on 32-bit AIX
+// RUN: %if target={{.*aix.*}} %{ \
+// RUN: %clang -target powerpc-ibm-aix -m32 -fsanitize=address %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LD32-ASAN %s \
+// RUN: %}
+// CHECK-LD32-ASAN: "-latomic"
----------------
honeygoyal wrote:
Hi @hubert-reinterpretcast,
Our focus on the 32‑bit AIX tests is intentional since the requirement to add
`-latomic` applies exclusively to that configuration. For non‑32‑bit (e.g.
64‑bit) targets, the flag isn’t needed—and its absence is verified by our
broader sanitizer test suite (like in sanitizer‑ld.c) covering general
sanitizer runtime behavior on non‑AIX platforms.
Thus, while a dedicated “sanitizer AND NOT 32‑bit” test might seem useful, it
would duplicate coverage already ensured by our existing tests.
https://github.com/llvm/llvm-project/pull/125388
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits