[cfe-dev] Test failuire: Driver/baremetal.cpp

David Greene via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 26 09:20:53 PDT 2018


I've configured clang to use gold, which seems to cause
test/Driver/baremetal.cpp to fail.  The test works like this:

// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN:     -target armv6m-none-eabi \
// RUN:     -T semihosted.lds \
// RUN:     -L some/directory/user/asked/for \
// RUN:     --sysroot=%S/Inputs/baremetal_arm \
// RUN:   | FileCheck --check-prefix=CHECK-V6M-C %s
// CHECK-V6M-C: "[[PREFIX_DIR:.*]]{{[/\\]+}}{{[^/^\\]+}}{{[/\\]+}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-none--eabi"
// CHECK-V6M-C-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
// CHECK-V6M-C-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
// CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
// CHECk-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
// CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
// CHECK-V6M-C-NEXT: "{{[^"]*}}ld.lld{{(\.exe)?}}" "{{.*}}.o" "-Bstatic"

The NEXT line is problematic as it assumes ld.lld.  I did not build lld,
though I could simply to get the test working.  But building lld is not
enough as I configured with CLANG_DEFAULT_LINKER=gold.  It seems like
the RUN line needs -fuse-ld=lld.

Is there a REQUIRES clause for lld being present and default?  I could
not find somthing appropriate in lit's config.available_features.

It's certainly possible I'm doing something wrong, as I assume many
people use gold with clang.  Maybe those people don't run the tests?

I am happy to update the test if someone can point me to a good REQUIRES
clause.

Thanks!

                                 -David



More information about the cfe-dev mailing list