LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 44798 - llvm/test/tools/UpdateTestChecks/update_cc_test_checks use clang but don't depend on clang
Summary: llvm/test/tools/UpdateTestChecks/update_cc_test_checks use clang but don't de...
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: support scripts (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-05 04:57 PST by Roman Lebedev
Modified: 2020-03-23 04:25 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s): rG61dd0603bd8a,rGc29310707e9a


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Lebedev 2020-02-05 04:57:26 PST
$ ninja check-llvm
[1/295] Generating VCSRevision.h
-- Found Git: /usr/bin/git (found version "2.25.0") 
[294/295] Running the LLVM regression tests
FAIL: LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test (33391 of 35753)
******************** TEST 'LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test' FAILED ********************
Script:
--
: 'RUN: at line 3';   cp /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c && '/usr/bin/python' /repositories/llvm-project/llvm/utils/update_cc_test_checks.py --clang /builddirs/llvm-project/build-Clang9-unknown/./bin/clang --opt /builddirs/llvm-project/build-Clang9-unknown/./bin/opt /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 4';   diff -u /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c.expected /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 6';   '/usr/bin/python' /repositories/llvm-project/llvm/utils/update_cc_test_checks.py --clang /builddirs/llvm-project/build-Clang9-unknown/./bin/clang --opt /builddirs/llvm-project/build-Clang9-unknown/./bin/opt /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
: 'RUN: at line 7';   diff -u /repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c.expected /builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 3"
$ "cp" "/repositories/llvm-project/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/Inputs/def-and-decl.c" "/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c"
$ "/usr/bin/python" "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py" "--clang" "/builddirs/llvm-project/build-Clang9-unknown/./bin/clang" "--opt" "/builddirs/llvm-project/build-Clang9-unknown/./bin/opt" "/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c"
# command stderr:
/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
WARNING: Could not determine clang builtins directory, some tests might not update correctly.
/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
Traceback (most recent call last):
  File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 304, in <module>
    sys.exit(main())
  File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 265, in main
    get_function_body(args, filename, clang_args, extra_commands, prefixes, triple_in_cmd, func_dict)
  File "/repositories/llvm-project/llvm/utils/update_cc_test_checks.py", line 161, in get_function_body
    raw_tool_output = common.invoke_tool(args.clang, clang_args, filename)
  File "/repositories/llvm-project/llvm/utils/UpdateTestChecks/common.py", line 50, in invoke_tool
    stdout = subprocess.check_output([exe] + cmd_args, stdin=ir_file)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/builddirs/llvm-project/build-Clang9-unknown/./bin/clang', '-cc1', '-triple', 'x86_64-unknown-linux-gnu', '/builddirs/llvm-project/build-Clang9-unknown/test/tools/UpdateTestChecks/update_cc_test_checks/Output/def-and-decl.test.tmp.c', '-emit-llvm', '-o', '-']' returned non-zero exit status 127

error: command failed with exit status: 1

--

********************

Testing Time: 702.24s
********************
Failing Tests (1):
    LLVM :: tools/UpdateTestChecks/update_cc_test_checks/def-and-decl.test

  Expected Passes    : 35113
  Expected Failures  : 149
  Unsupported Tests  : 490
  Unexpected Failures: 1
FAILED: test/CMakeFiles/check-llvm 
cd /builddirs/llvm-project/build-Clang9-unknown/test && /usr/bin/python /builddirs/llvm-project/build-Clang9-unknown/./bin/llvm-lit -sv /builddirs/llvm-project/build-Clang9-unknown/test
ninja: build stopped: subcommand failed.
Comment 1 Alexander Richardson 2020-02-05 07:36:34 PST
The tests should be checking for the presence of clang and be UNSUPPORTED if it's not avilable: https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/UpdateTestChecks/update_cc_test_checks/lit.local.cfg

I checked that the tests don't run if I delete bin/clang from the build directory.

This seems like your build directory contains a broken clang?

/builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup error: /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
Comment 2 Alexander Richardson 2020-02-05 07:37:35 PST
I am not sure if it's possible to add a cmake dependency just for those tests since the clang target is probably not defined when they run?
Comment 3 Roman Lebedev 2020-02-05 07:43:40 PST
(In reply to Alexander Richardson from comment #1)
> The tests should be checking for the presence of clang and be UNSUPPORTED if
> it's not avilable:
> https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/
> UpdateTestChecks/update_cc_test_checks/lit.local.cfg
> 
> I checked that the tests don't run if I delete bin/clang from the build
> directory.
> 
> This seems like your build directory contains a broken clang?
What makes you think it's broken? It's simply not rebuilt.
And that is a perfectly correct state,
because buildsystem wasn't asked whether clang is up-to-date and usable.

> /builddirs/llvm-project/build-Clang9-unknown/./bin/clang: symbol lookup
> error:
> /builddirs/llvm-project/build-Clang9-unknown/bin/../lib/libclangCodeGen.so.
> 11git: undefined symbol: _ZN4llvm20RemarkSetupFileError2IDE
Comment 4 Alexander Richardson 2020-02-05 07:59:01 PST
(In reply to Roman Lebedev from comment #3)
> (In reply to Alexander Richardson from comment #1)
> > This seems like your build directory contains a broken clang?
> What makes you think it's broken? It's simply not rebuilt.
> And that is a perfectly correct state,
> because buildsystem wasn't asked whether clang is up-to-date and usable.

Yes sorry, I realized after posting that comment what the real issue is. I've posted https://reviews.llvm.org/D74051 which should fix it.
Seems like it is indeed possible to add the clang depedency.

I am not sure if this is desirable, but I can't see a better solution that allows incremental check-llvm to work.
Comment 5 Simon Pilgrim 2020-02-05 13:39:40 PST
Shouldn't this test live in 

clangtest/tools/UpdateTestChecks/update_cc_test_checks

or similar?
Comment 6 Simon Pilgrim 2020-03-23 04:25:59 PDT
D74051 landed at rG61dd0603bd8a, moving the tests into clang\test\utils\update_cc_test_checks