Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeGen/flatten.c and CodeGenCXX/flatten.cpp tests fail when building clang standalone #50706

Closed
llvmbot opened this issue Aug 5, 2021 · 5 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 5, 2021

Bugzilla Link 51364
Resolution FIXED
Resolved on Oct 11, 2021 20:29
Version unspecified
OS Linux
Blocks #51489
Reporter LLVM Bugzilla Contributor
CC @zygoloid,@tstellar
Fixed by commit(s) 889a1e6 4dd6815

Extended Description

I can reproduce by:

  1. Installing LLVM 13.0.0rc1 to the system (static libs/dylib don't seem to matter).

  2. Build clang against it:

cmake .. -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_MAIN_SRC_DIR=/home/mgorny/git/llvm-project/llvm -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
ninja check-clang

The tests used to pass 100% in 12.0.1. They also pass in a combined LLVM+Clang build. I haven't been able to pinpoint a specific difference between these two builds.

The test failures are:

FAIL: Clang :: CodeGenCXX/flatten.cpp (14777 of 28338)
******************** TEST 'Clang :: CodeGenCXX/flatten.cpp' FAILED ********************
Script:

: 'RUN: at line 5'; /home/mgorny/git/llvm-project/clang/build/bin/clang -cc1 -internal-isystem /home/mgorny/git/llvm-project/clang/build/lib64/clang/13.0.0/include -nostdsysteminc -triple=x86_64-linux-gnu -std=c++11 /home/mgorny/git/llvm-project/clang/test/CodeGenCXX/flatten.cpp -emit-llvm -o - | /usr/lib/llvm/13/bin/FileCheck /home/mgorny/git/llvm-project/clang/test/CodeGenCXX/flatten.cpp

Exit Code: 1

Command Output (stderr):

/home/mgorny/git/llvm-project/clang/test/CodeGenCXX/flatten.cpp:12:16: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: call {{.*}} @​_Z1fv
^
:15:2: note: found here
call void @​_Z1fv() #​1
^~~~~~~~~~~~~~~~

Input file:
Check file: /home/mgorny/git/llvm-project/clang/test/CodeGenCXX/flatten.cpp

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

Input was:
<<<<<<
.
.
.
10: }
11:
12: ; Function Attrs: mustprogress noinline nounwind optnone
13: define dso_local void @​_Z1gv() #​0 {
14: entry:
15: call void @​_Z1fv() #​1
not:12 !~~~~~~~~~~~~~~~ error: no match expected
16: ret void
17: }
18:
19: attributes #​0 = { mustprogress noinline nounwind optnone "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
20: attributes #​1 = { alwaysinline }
.
.
.

--


FAIL: Clang :: CodeGen/flatten.c (22861 of 28338)
******************** TEST 'Clang :: CodeGen/flatten.c' FAILED ********************
Script:

: 'RUN: at line 7'; /home/mgorny/git/llvm-project/clang/build/bin/clang -cc1 -internal-isystem /home/mgorny/git/llvm-project/clang/build/lib64/clang/13.0.0/include -nostdsysteminc -triple=x86_64-linux-gnu /home/mgorny/git/llvm-project/clang/test/CodeGen/flatten.c -emit-llvm -o - | /usr/lib/llvm/13/bin/FileCheck /home/mgorny/git/llvm-project/clang/test/CodeGen/flatten.c

Exit Code: 1

Command Output (stderr):

/home/mgorny/git/llvm-project/clang/test/CodeGen/flatten.c:16:16: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: call {{.*}} @​f
^
:21:2: note: found here
call void @​f() #​1
^~~~~~~~~~~~

Input file:
Check file: /home/mgorny/git/llvm-project/clang/test/CodeGen/flatten.c

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

Input was:
<<<<<<
.
.
.
16: }
17:
18: ; Function Attrs: noinline nounwind optnone
19: define dso_local void @​g() #​0 {
20: entry:
21: call void @​f() #​1
not:16 !~~~~~~~~~~~ error: no match expected
22: call void @​ni()
23: ret void
24: }
25:
26: ; Function Attrs: noinline nounwind optnone
.
.
.

--


@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 6, 2021

I'm currently bisecting it and I'm pretty close to the end. I'm afraid this is an old change (around Jan-Feb) that broke it :-(.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 6, 2021

Ok, so the problem is that LLVM doesn't export LLVM_ENABLE_NEW_PASS_MANAGER, so when doing standalone builds, clang assumes it's off and runs tests that should normally be skipped. I've submitted a patch to add it to LLVMConfig.cmake.in.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 6, 2021

Now pushed to main as:

commit 889a1e6
Author: Michał Górny mgorny@moritz.systems
Date: 2021-08-06 10:56:54 +0200

[llvm] [cmake] Export LLVM_ENABLE_NEW_PASS_MANAGER into LLVMConfig.cmake

Include the vaue of LLVM_ENABLE_NEW_PASS_MANAGER in generated
LLVMConfig.cmake since it is needed by clang's build system.  This fixes
test failures when the new pass manager is enabled (i.e. by default)
by having clang's CMake files correctly detect that and skip relevant
tests.

Differential Revision: https://reviews.llvm.org/D107628

@tstellar
Copy link
Collaborator

Merged: 4dd6815

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants