Page MenuHomePhabricator

Fix driver test from e16c0a9a689719
ClosedPublic

Authored by thakis on Nov 24 2020, 6:46 AM.

Details

Summary

The test failed silently if lld wasn't built alongside clang.
But the test uses -###, so the "invalid linker name in -fuse-ld=lld"
diag didn't make clang fail, and something else happened to match
"-demangle", so the test passed.

To fix, pass -B to a directory with two empty +x files (which works
on non-Windows), and look for "-demangle" instead of just -demangle.
Also force linker_version to 0 and pass a darwin triple.

Diff Detail

Event Timeline

thakis requested review of this revision.Nov 24 2020, 6:46 AM
thakis created this revision.
hans accepted this revision.Nov 24 2020, 7:02 AM
hans added inline comments.
clang/test/Driver/darwin-ld-demangle-lld.c
11

nit: most tests have a blank line between the RUN block and the checks/other stuff

This revision is now accepted and ready to land.Nov 24 2020, 7:02 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2020, 7:51 AM

This is breaking building on Fedora 33 (x86-64). Can we revert this or get a quick fix?

--
Exit Code: 1

Command Output (stdout):
--
 "/tmp/_update_lc/r/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "i386" "-macosx_version_min" "10.5.0" "-o" "/tmp/darwin-ld-24b2aa.out" "-lcrt1.10.5.o" "/tmp/darwin-ld-44e1b0.o" "-arch_multiple" "-final_output" "foo" "-lSystem"
 "/tmp/_update_lc/r/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.5.0" "-o" "/tmp/darwin-ld-9401c6.out" "-lcrt1.10.5.o" "/tmp/darwin-ld-76c470.o" "-arch_multiple" "-final_output" "foo" "-lSystem"
 "/tmp/_update_lc/r/bin/dsymutil" "-o" "BAR.dSYM" "BAR"
 "/tmp/_update_lc/r/bin/dsymutil" "-o" "BAR.dSYM" "BAR"

--
Command Output (stderr):
--
/home/dave/ro_s/lp/clang/test/Driver/darwin-ld.c:102:31: error: LINK_OLDER_NODEMANGLE-NOT: excluded string found in input
// LINK_OLDER_NODEMANGLE-NOT: "-demangle"
                              ^
<stdin>:5:35: note: found here
 "/tmp/_update_lc/r/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "/tmp/_update_lc/r/tools/clang/test/Driver/Output/darwin-ld.c.tmp.o" "-lSystem"
                                  ^~~~~~~~~~~

Input file: <stdin>
Check file: /home/dave/ro_s/lp/clang/test/Driver/darwin-ld.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
         1: clang version 12.0.0 (https://github.com/llvm/llvm-project.git e4d9380245518ee8dcb765eb2e5f4f2788b53cc6)
         2: Target: x86_64-apple-darwin10
         3: Thread model: posix
         4: InstalledDir: /tmp/_update_lc/r/bin
         5:  "/tmp/_update_lc/r/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "/tmp/_update_lc/r/tools/clang/test/Driver/Output/darwin-ld.c.tmp.o" "-lSystem"
not:102                                       !~~~~~~~~~~                                                                                                                                                                         error: no match expected
>>>>>>

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
********************
Failed Tests (1):
  Clang :: Driver/darwin-ld.c


Testing Time: 103.43s
  Unsupported      : 11105
  Passed           : 60786
  Expectedly Failed:   100
  Failed           :     1
FAILED: CMakeFiles/check-all