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

Port gcc-dg tests from GCC #49

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mohammed-nurulhoque
Copy link

This was copied from a snapshot of gcc at 0c37fef39fa. The allowlist was tested using glibc and qemu on riscv.
Would appreciate any help regarding copyrights, what notices should be included

@jerryzj
Copy link
Contributor

jerryzj commented Nov 14, 2023

Cool, I am going to test it in our downstream.

Copy link
Contributor

@jerryzj jerryzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build failed on my end, please consider add the following

git diff SingleSource/Regression/DgOptions.txt
diff --git a/SingleSource/Regression/DgOptions.txt b/SingleSource/Regression/DgOptions.txt
index 935899dfc..f951ce935 100644
--- a/SingleSource/Regression/DgOptions.txt
+++ b/SingleSource/Regression/DgOptions.txt
@@ -8,9 +8,13 @@ set(CLANG_ERRORING_CFLAGS
   "-fopt-"
   "-fno-ipa-"
   "-fno-ira-"
+  "-fno-ira-share-spill-slots"
   "-ftree-loop-"
+  "-ftree-loop-distribution"
   "-fno-tree-b"
+  "-fno-tree-bit-ccp"
   "-fno-tree-c"
+  "-fno-tree-coalesce-vars"
   "-fno-tree-d"
   "-fno-tree-f"
   "-fno-tree-t"

@jerryzj
Copy link
Contributor

jerryzj commented Nov 15, 2023

In the main branch, lit has 2437 test cases. However, in your branch, lit is missing 1503 test cases.

@dtcxzyw
Copy link
Member

dtcxzyw commented Nov 15, 2023

Why not keep these tests out-of-tree like SPEC benchmarks? I think they are licensed under GPL.

@asb
Copy link

asb commented Nov 15, 2023

Why not keep these tests out-of-tree like SPEC benchmarks? I think they are licensed under GPL.

The test suite already has a variety of different licenses, including GPL. I think it's convenient to have the sources in-tree when the license allows it. Are there any other tests that are kept out of tree that are open source?

@mohammed-nurulhoque
Copy link
Author

Build failed on my end, please consider add the following

Fixed. The error flags where supposed to be excluded by regex

@mohammed-nurulhoque
Copy link
Author

In the main branch, lit has 2437 test cases. However, in your branch, lit is missing 1503 test cases.

Do you mean gcc main? This PR only added the tests directly in gcc.dg without the subdirectories. If you mean the main of this repo, this PR only adds tests. It doesn't remove.

@jerryzj
Copy link
Contributor

jerryzj commented Nov 23, 2023

Do you mean gcc main? This PR only added the tests directly in gcc.dg without the subdirectories. If you mean the main of this repo, this PR only adds tests. It doesn't remove.

No. I meant llvm-test-suite.
Your patch causes the entire test suite to lose many test cases. Another thing I noticed is that your newly added tests don't even start. You can check the test.log for more details.

The test result of llvm-test-suite main

********************
Failed Tests (2):
  test-suite :: SingleSource/UnitTests/X86/x86-dyn_stack_alloc_realign.test
  test-suite :: SingleSource/UnitTests/X86/x86-dyn_stack_alloc_realign2.test


Testing Time: 152.57s
  Passed: 2509
  Failed:    2

On your branch

********************
Failed Tests (2):
  test-suite :: SingleSource/UnitTests/X86/x86-dyn_stack_alloc_realign.test
  test-suite :: SingleSource/UnitTests/X86/x86-dyn_stack_alloc_realign2.test


Testing Time: 151.32s
  Passed: 948
  Failed:   2

common parts between C/gcc-c-torture/CMakeLists.txt and the new
C/gcc-dg/CMakeLists.txt are put in DgOptions.txt
@mohammed-nurulhoque
Copy link
Author

Your patch causes the entire test suite to lose many test cases.

Oh that was probably because my branch wasn't rebased to latest master. I did now

Another thing I noticed is that your newly added tests don't even start

It wasn't included by default. Had to be included explcitly with -DTEST_SUITE_SUBDIRS. Now changed to include by default.

@mohammed-nurulhoque
Copy link
Author

Gentle ping for this

@jerryzj
Copy link
Contributor

jerryzj commented Nov 30, 2023

I'm getting the following error on x86 clang 17.0.4

FAILED: SingleSource/Regression/C/gcc-dg/GCC-DG_atomic-compare-exchange-5
: && /home/jzhangjian/scratch/llvm-test-suite/build/tools/timeit --summary SingleSource/Regression/C/gcc-dg/GCC-DG_atomic-compare-exchange-5.link.time /sifive/tools/clang/17.0.4/bin/clang -O3  SingleSource/Regression/C/gcc-dg/CMakeFiles/GCC-DG_atomic-compare-exchange-5.dir/atomic-compare-exchange-5.c.o -o SingleSource/Regression/C/gcc-dg/GCC-DG_atomic-compare-exchange-5   && cd /home/jzhangjian/scratch/llvm-test-suite/build/SingleSource/Regression/C/gcc-dg && /sifive/tools/clang/17.0.4/bin/llvm-size --format=sysv /home/jzhangjian/scratch/llvm-test-suite/build/SingleSource/Regression/C/gcc-dg/GCC-DG_atomic-compare-exchange-5 > /home/jzhangjian/scratch/llvm-test-suite/build/SingleSource/Regression/C/gcc-dg/GCC-DG_atomic-compare-exchange-5.size
SingleSource/Regression/C/gcc-dg/CMakeFiles/GCC-DG_atomic-compare-exchange-5.dir/atomic-compare-exchange-5.c.o: In function `main':
atomic-compare-exchange-5.c:(.text+0x31): undefined reference to `__atomic_compare_exchange'
atomic-compare-exchange-5.c:(.text+0x7d): undefined reference to `__atomic_compare_exchange'
atomic-compare-exchange-5.c:(.text+0xd7): undefined reference to `__atomic_compare_exchange'
atomic-compare-exchange-5.c:(.text+0x149): undefined reference to `__atomic_compare_exchange'
atomic-compare-exchange-5.c:(.text+0x199): undefined reference to `__atomic_compare_exchange'
SingleSource/Regression/C/gcc-dg/CMakeFiles/GCC-DG_atomic-compare-exchange-5.dir/atomic-compare-exchange-5.c.o:atomic-compare-exchange-5.c:(.text+0x205): more undefined references to `__atomic_compare_exchange' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

I suppose that we need -latomic linker flag to fix this.

@mablinov
Copy link

mablinov commented Jan 5, 2024

Hi all, I've picked up and continued Mohammed's work in a new MR here - I hope this is the appropriate workflow, please let me know if I should do this differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants