[clang] Fix --print-libgcc-file-name on Darwin platforms (PR #98325)
Louis Dionne via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 10 09:15:56 PDT 2024
================
@@ -0,0 +1,97 @@
+// Test the output of -print-libgcc-file-name on Darwin.
----------------
ldionne wrote:
It looks like the embedded targets are already tested to some extent inside `clang/test/Driver/darwin-embedded.c`. I would add a new test file `clang/test/Driver/darwin-embedded-print-libgcc-file-name.c` and add something like this in it:
```
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
// RUN: --target=armv7em-apple-darwin \
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-HARD_STATIC %s
// CHECK-CLANGRT-HARD_STATIC: libclang_rt.hard_static.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
// RUN: --target=armv7em-apple-darwin -msoft-float \
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-SOFT_STATIC %s
// CHECK-CLANGRT-SOFT_STATIC: libclang_rt.soft_static.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
// RUN: --target=armv7em-apple-darwin -fPIC \
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-HARD_PIC %s
// CHECK-CLANGRT-HARD_PIC: libclang_rt.hard_pic.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
// RUN: --target=armv7em-apple-darwin -msoft-float -fPIC \
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-SOFT_PIC %s
// CHECK-CLANGRT-SOFT_PIC: libclang_rt.soft_pic.a
```
I'm not certain what we're testing, but we're testing the behavior that seems to exist today, so at least we'll have coverage for whatever we do today.
https://github.com/llvm/llvm-project/pull/98325
More information about the cfe-commits
mailing list