Skip to content

Commit 6a04ea7

Browse files
rschatzeregon
authored andcommitted
Remove dragonegg-based LLVM tests.
1 parent 1af6866 commit 6a04ea7

File tree

64 files changed

+7
-2802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+7
-2802
lines changed

Diff for: sulong/ci/ci.jsonnet

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ local sc = (import "ci_common/sulong-common.jsonnet");
6767
$.sulong + $.gate(standalone=true) + sc.labsjdkLatest + sc.linux_amd64 + sc.llvmBundled + sc.requireGMP + sc.requireGCC + sc.gateTags("build,sulongMisc,parser") + $.sulong_test_toolchain + { name: "gate-sulong-misc-parser-jdk-latest-linux-amd64" },
6868
$.sulong + $.gate() + sc.labsjdkLatest + sc.linux_amd64 + sc.llvmBundled + sc.requireGMP + sc.gateTags("build,gcc_c") + { name: "gate-sulong-gcc_c-jdk-latest-linux-amd64", timelimit: "45:00" },
6969
$.sulong + $.gate() + sc.labsjdkLatest + sc.linux_amd64 + sc.llvmBundled + sc.requireGMP + sc.gateTags("build,gcc_cpp") + { name: "gate-sulong-gcc_cpp-jdk-latest-linux-amd64", timelimit: "45:00" },
70-
$.sulong + $.gate() + sc.labsjdkLatest + sc.linux_amd64 + sc.llvmBundled + sc.requireGMP + sc.requireGCC + sc.gateTags("build,gcc_fortran") + { name: "gate-sulong-gcc_fortran-jdk-latest-linux-amd64" },
7170

7271
$.sulong + $.gate() + sc.labsjdkLatest + sc.darwin_amd64 + sc.llvmBundled + sc.gateTags(basicTags) + { name: "gate-sulong-basic-nwcc-llvm-jdk-latest-darwin-amd64", timelimit: "0:45:00", capabilities+: ["ram16gb"] },
7372

Diff for: sulong/ci/ci_common/sulong-common.jsonnet

-5
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,11 @@ local sulong_deps = common.deps.sulong;
188188
packages+: {
189189
gcc: "==6.1.0",
190190
},
191-
downloads+: {
192-
DRAGONEGG_GCC: { name: "gcc+dragonegg", version: "4.6.4-1", platformspecific: true },
193-
DRAGONEGG_LLVM: { name: "clang+llvm", version: "3.2", platformspecific: true },
194-
},
195191
},
196192

197193
# like requireGCC, but only on linux/amd64, ignored otherwise
198194
optionalGCC:: {
199195
packages+: if self.os == "linux" && self.arch == "amd64" then $.requireGCC.packages else {},
200-
downloads+: if self.os == "linux" && self.arch == "amd64" then $.requireGCC.downloads else {},
201196
},
202197

203198
requireGMP:: {

Diff for: sulong/docs/contributor/TESTS.md

-25
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,6 @@ Another useful `mx unittest` flag is `--color`, which makes the output easier to
156156
To attach a debugger to Sulong tests, run `mx` with the `-d` argument, e.g.
157157
`mx -d unittest SulongSuite` or `mx -d gate --tags sulong`.
158158

159-
## Fortran
160-
161-
Some of our tests are Fortran files. Make sure you have GCC, G++, and GFortran
162-
in version 4.5, 4.6 or 4.7 available.
163-
164-
On the Mac you can use Homebrew:
165-
166-
brew tap homebrew/versions
167-
brew install gcc46 --with-fortran
168-
brew link --force gmp4
169-
170-
For the Fortran tests you also need to provide
171-
[DragonEgg](http://dragonegg.llvm.org/) 3.2 and Clang 3.2.
172-
173-
[DragonEgg](http://dragonegg.llvm.org/) is a GCC plugin with which we
174-
can use GCC to compile a source language to LLVM IR. Sulong uses
175-
DragonEgg in its test cases to compile Fortran files to LLVM IR.
176-
Sulong also uses DragonEgg for the C/C++ test cases besides Clang to get
177-
additional "free" test cases for a given C/C++ file. DragonEgg requires
178-
a GCC in the aforementioned versions.
179-
180-
- Sulong expects to find Clang 3.2 in `$DRAGONEGG_LLVM/bin`
181-
- Sulong expects to find GCC 4.5, 4.6 or 4.7 in `$DRAGONEGG_GCC/bin`
182-
- Sulong expects to find `dragonegg.so` under `$DRAGONEGG` or in `$DRAGONEGG_GCC/lib`
183-
184159
## Test Exclusion
185160

186161
Not all tests work under all circumstances. Especially external test suites,

Diff for: sulong/mx.sulong/mx_sulong_gate.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -185,7 +185,6 @@ def _unittest(title, test_suite, tags=None, testClasses=None, unittestArgs=None,
185185
_unittest('GCCParserTorture', 'SULONG_PARSER_TORTURE', description="Parser test using GCC suite", testClasses=['ParserTortureSuite'], tags=['parser'])
186186
_unittest('GCC_C', 'SULONG_GCC_C_TEST_SUITE', description="GCC 5.2 test suite (C tests)", testClasses=['GccCSuite'], tags=['gcc_c'])
187187
_unittest('GCC_CPP', 'SULONG_GCC_CPP_TEST_SUITE', description="GCC 5.2 test suite (C++ tests)", testClasses=['GccCppSuite'], tags=['gcc_cpp'])
188-
_unittest('GCC_Fortran', 'SULONG_GCC_FORTRAN_TEST_SUITE', description="GCC 5.2 test suite (Fortran tests)", testClasses=['GccFortranSuite'], tags=['gcc_fortran'])
189188
_unittest('Sulong', 'SULONG_STANDALONE_TEST_SUITES', description="Sulong's internal tests", testClasses='SulongSuite', tags=['sulongStandalone', 'sulongBasic', 'standalone'],
190189
# run only a small subset of the tests on the jvm standalone, the startup overhead per test is too high for more
191190
extraUnittestArgs=['-Dsulongtest.testNameFilter=cpp'] if slowStandalone else [])

Diff for: sulong/mx.sulong/mx_sulong_suite_constituents.py

+1-66
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -75,60 +75,12 @@ def compileTestSuite(testsuiteproject, extra_build_args):
7575
mx.command_function('build')(defaultBuildArgs + extra_build_args)
7676

7777

78-
class DragonEggSupport:
79-
"""Helpers for DragonEgg
80-
81-
DragonEgg support is controlled by two environment variables:
82-
* `DRAGONEGG_GCC`: path to a GCC installation with dragonegg support
83-
* `DRAGONEGG_LLVM`: path to an LLVM installation that can deal with bitcode produced by DragonEgg
84-
* `DRAGONEGG`: (optional) path to folder that contains the `libdragonegg.so`
85-
"""
86-
87-
@staticmethod
88-
def haveDragonegg():
89-
if not hasattr(DragonEggSupport, '_haveDragonegg'):
90-
DragonEggSupport._haveDragonegg = DragonEggSupport.pluginPath() is not None and os.path.exists(
91-
DragonEggSupport.pluginPath()) and DragonEggSupport.findGCCProgram('gcc', optional=True) is not None
92-
return DragonEggSupport._haveDragonegg
93-
94-
@staticmethod
95-
def pluginPath():
96-
if 'DRAGONEGG' in os.environ:
97-
return os.path.join(os.environ['DRAGONEGG'], mx.add_lib_suffix('dragonegg'))
98-
if 'DRAGONEGG_GCC' in os.environ:
99-
path = os.path.join(os.environ['DRAGONEGG_GCC'], 'lib', mx.add_lib_suffix('dragonegg'))
100-
if os.path.exists(path):
101-
return path
102-
return None
103-
104-
@staticmethod
105-
def findLLVMProgram(program, optional=False):
106-
if 'DRAGONEGG_LLVM' in os.environ:
107-
path = os.environ['DRAGONEGG_LLVM']
108-
return os.path.join(path, 'bin', program)
109-
if optional:
110-
return None
111-
mx.abort("Cannot find LLVM program for dragonegg: {}\nDRAGONEGG_LLVM environment variable not set".format(program))
112-
113-
@staticmethod
114-
def findGCCProgram(gccProgram, optional=False):
115-
if 'DRAGONEGG_GCC' in os.environ:
116-
path = os.environ['DRAGONEGG_GCC']
117-
return os.path.join(path, 'bin', gccProgram)
118-
if optional:
119-
return None
120-
mx.abort("Cannot find GCC program for dragonegg: {}\nDRAGONEGG_GCC environment variable not set".format(gccProgram))
121-
122-
12378
class SulongTestSuiteMixin(object, metaclass=abc.ABCMeta):
12479

12580
def getVariants(self):
12681
if not hasattr(self, '_variants'):
12782
self._variants = []
12883
for v in self.variants:
129-
if 'gcc' in v and not DragonEggSupport.haveDragonegg():
130-
mx.warn('Could not find dragonegg, not building test variant "%s"' % v)
131-
continue
13284
self._variants.append(v)
13385
return self._variants
13486

@@ -311,14 +263,6 @@ def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
311263
env['GRAALVM_LLVM_HOME'] = mx_subst.path_substitutions.substitute("<path:SULONG_HOME>")
312264
if 'OS' not in env:
313265
env['OS'] = mx_subst.path_substitutions.substitute("<os>")
314-
if DragonEggSupport.haveDragonegg():
315-
env['DRAGONEGG'] = DragonEggSupport.pluginPath()
316-
env['DRAGONEGG_GCC'] = DragonEggSupport.findGCCProgram('gcc', optional=False)
317-
env['DRAGONEGG_LLVMAS'] = DragonEggSupport.findLLVMProgram("llvm-as")
318-
env['DRAGONEGG_FC'] = DragonEggSupport.findGCCProgram('gfortran', optional=False)
319-
env['FC'] = DragonEggSupport.findGCCProgram('gfortran', optional=False)
320-
elif not self._is_needs_rebuild_call and getattr(self, 'requireDragonegg', False):
321-
mx.abort('Could not find dragonegg, cannot build "{}" (requireDragonegg = True).'.format(self.name))
322266
return env
323267

324268
def getTestFile(self):
@@ -525,8 +469,6 @@ class SulongCMakeTestSuite(SulongTestSuiteMixin, mx_cmake.CMakeNinjaProject): #
525469
The source file is compiled to an executable with an embedded bitcode section.
526470
- "toolchain"
527471
The toolchain wrappers are used to compile the test source into an executable with embedded bitcode.
528-
- "gcc"
529-
The source is compiled to bitcode using gcc and the DRAGONEGG plugin.
530472
buildRef:
531473
If True (the default), build a reference executable. Setting this to False is useful for embedded tests with
532474
dedicated JUnit test classes.
@@ -597,13 +539,6 @@ def _default_cmake_vars(self):
597539
_config['LLVM_CONFIG'] = mx_sulong.findBundledLLVMProgram('llvm-config')
598540
_config['LLVM_OBJCOPY'] = mx_sulong.findBundledLLVMProgram('llvm-objcopy')
599541
_config['CMAKE_NM'] = mx_sulong.findBundledLLVMProgram('llvm-nm')
600-
if DragonEggSupport.haveDragonegg():
601-
_config['DRAGONEGG'] = DragonEggSupport.pluginPath()
602-
_config['DRAGONEGG_GCC'] = DragonEggSupport.findGCCProgram('gcc', optional=False)
603-
_config['DRAGONEGG_LLVM_LINK'] = DragonEggSupport.findLLVMProgram("llvm-link")
604-
_config['DRAGONEGG_LLVMAS'] = DragonEggSupport.findLLVMProgram("llvm-as")
605-
_config['DRAGONEGG_FC'] = DragonEggSupport.findGCCProgram('gfortran', optional=False)
606-
_config['FC'] = DragonEggSupport.findGCCProgram('gfortran', optional=False)
607542
return _config
608543

609544
def cmake_config(self):

Diff for: sulong/mx.sulong/suite.py

+1-46
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,6 @@
5454
},
5555
# Support Libraries.
5656
# Projects depending on these will *not be built* if the 'optional' is 'True' for the given OS/architecture.
57-
# This is a dummy library for dragonegg support.
58-
"DRAGONEGG_SUPPORT" : {
59-
"os_arch" : {
60-
"linux" : {
61-
"amd64" : {
62-
"path": "tests/support.txt",
63-
"digest": "sha512:c02b248975b267f4200603ff2ae40b9d0cdefad4a792f386d610f2b14fb4e67e288c235fd11ed596dd8c91a3dae62fdd741bf97b5c01b5f085485f221702f0a1",
64-
},
65-
"<others>": {"optional": True},
66-
},
67-
"<others>": {"<others>" : {"optional": True}},
68-
},
69-
},
7057
# This is a dummy library for malloc.h support.
7158
"MALLOC_H_SUPPORT" : {
7259
"os_arch" : {
@@ -1119,7 +1106,7 @@
11191106
"com.oracle.truffle.llvm.tests.sulong.native" : {
11201107
"subDir" : "tests",
11211108
"class" : "SulongCMakeTestSuite",
1122-
"variants" : ["bitcode-O0", "bitcode-O1", "bitcode-O2", "bitcode-O3", "gcc-O0"],
1109+
"variants" : ["bitcode-O0", "bitcode-O1", "bitcode-O2", "bitcode-O3"],
11231110
"dependencies" : ["SULONG_TEST"],
11241111
"testProject" : True,
11251112
"defaultBuild" : False,
@@ -1534,28 +1521,6 @@
15341521
"testProject" : True,
15351522
"defaultBuild" : False,
15361523
},
1537-
"gcc_fortran" : {
1538-
"subDir" : "tests/gcc",
1539-
# The Ninja generator used by mx (version 1.8.2) does not support Fortran using Ninja version [GR-30808]
1540-
# "class" : "ExternalCMakeTestSuite",
1541-
# "variants" : ["executable-O0"],
1542-
"class" : "ExternalTestSuite",
1543-
"variants" : ["O0_OUT"],
1544-
"testDir" : "gcc-5.2.0/gcc/testsuite",
1545-
"fileExts" : [".f90", ".f", ".f03"],
1546-
"requireDragonegg" : True,
1547-
"native" : True,
1548-
"vpath" : True,
1549-
"single_job" : True, # problem with parallel builds and temporary module files
1550-
"buildRef" : True,
1551-
"dependencies" : ["SULONG_TEST"],
1552-
"buildDependencies" : [
1553-
"GCC_SOURCE",
1554-
"DRAGONEGG_SUPPORT",
1555-
],
1556-
"testProject" : True,
1557-
"defaultBuild" : False,
1558-
},
15591524
"parserTorture" : {
15601525
"subDir" : "tests/gcc",
15611526
"class" : "ExternalCMakeTestSuite",
@@ -2271,16 +2236,6 @@
22712236
"testDistribution" : True,
22722237
"defaultBuild" : False,
22732238
},
2274-
"SULONG_GCC_FORTRAN_TEST_SUITE" : {
2275-
"native" : True,
2276-
"relpath" : True,
2277-
"platformDependent" : True,
2278-
"layout" : {
2279-
"./" : ["dependency:gcc_fortran/*"],
2280-
},
2281-
"testDistribution" : True,
2282-
"defaultBuild" : False,
2283-
},
22842239
"SULONG_PARSER_TORTURE" : {
22852240
"native" : True,
22862241
"relpath" : True,

Diff for: sulong/tests/Makefile.common

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates.
2+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -166,12 +166,6 @@ endif
166166
@mkdir -p $(shell dirname $@)
167167
$(QUIETLY) $(FC) -w -J$(shell dirname $@) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) -g -o $@ $^
168168

169-
%.bc: %.dragonegg.ll
170-
$(QUIETLY) $(DRAGONEGG_LLVMAS) -o $@ $<
171-
172-
%/gcc_O0.bc: %/gcc_O0.ll
173-
$(QUIETLY) $(DRAGONEGG_LLVMAS) -o $@ $<
174-
175169
%_MEM2REG.bc: %.bc
176170
$(QUIETLY) $(OPT) -o $@ -passes=mem2reg $<
177171

@@ -213,31 +207,10 @@ define OPT_RULES
213207
@mkdir -p $$(shell dirname $$@)
214208
$(QUIETLY) $(CLANGXX) -c -emit-llvm $(2) -Wall -Wextra -Werror -Wno-unused-command-line-argument $(CPPFLAGS) $(CXXFLAGS) -g -o $$@ $$<
215209

216-
%.f.dir/$(1).dragonegg.ll: %.f
217-
@mkdir -p $$(shell dirname $$@)
218-
$(QUIETLY) $(DRAGONEGG_FC) -w -S -fplugin=$(DRAGONEGG) -fplugin-arg-dragonegg-emit-ir -$(1) -J$$(shell dirname $$@) $(CPPFLAGS) $(FFLAGS) -o $$@ $$<
219-
220-
%.f90.dir/$(1).dragonegg.ll: %.f90
221-
@mkdir -p $$(shell dirname $$@)
222-
$(QUIETLY) $(DRAGONEGG_FC) -w -S -fplugin=$(DRAGONEGG) -fplugin-arg-dragonegg-emit-ir -$(1) -J$$(shell dirname $$@) $(CPPFLAGS) $(FFLAGS) -o $$@ $$<
223-
224-
%.f03.dir/$(1).dragonegg.ll: %.f03
225-
@mkdir -p $$(shell dirname $$@)
226-
$(QUIETLY) $(DRAGONEGG_FC) -w -S -fplugin=$(DRAGONEGG) -fplugin-arg-dragonegg-emit-ir -$(1) -J$$(shell dirname $$@) $(CPPFLAGS) $(FFLAGS) -o $$@ $$<
227-
228-
%.c.dir/gcc_$(1).ll: %.c
229-
@mkdir -p $$(shell dirname $$@)
230-
$(QUIETLY) $(DRAGONEGG_GCC) -w -S --std=gnu99 -fplugin=$(DRAGONEGG) -fplugin-arg-dragonegg-emit-ir -$(1) $(CPPFLAGS) $(CFLAGS) -o $$@ $$<
231-
232210
%.ll.dir/$(1).bc: %.ll
233211
@mkdir -p $$(shell dirname $$@)
234212
$(QUIETLY) $(LLVM_LINK) -o $$@ $$^
235213

236-
%.c.dir/gcc_$(1).ll: %.c
237-
@mkdir -p $$(shell dirname $$@)
238-
$(QUIETLY) $(DRAGONEGG_GCC) -w -S --std=gnu99 -fplugin=$(DRAGONEGG) -fplugin-arg-dragonegg-emit-ir -$(1) $(CPPFLAGS) $(CFLAGS) -o $$@ $$<
239-
240-
241214
%.c.dir/$(1)_OUT.bc: %.c
242215
@mkdir -p $$(shell dirname $$@)
243216
$(QUIETLY) $(CLANG) $(EMBED_BC) $(2) -Wall -Wextra -Werror -Wno-unused-command-line-argument $(CPPFLAGS) $(CFLAGS) -g $(LDFLAGS) -o $$@ $$<

Diff for: sulong/tests/com.oracle.truffle.llvm.tests.cmake/SulongTestSuite.cmake

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2022, 2025, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -91,14 +91,6 @@ set(LLVM_AS "" CACHE STRING "LLVM bitcode assembler")
9191
set(LLVM_OPT "" CACHE STRING "LLVM opt tool")
9292
set(LLVM_OBJCOPY "" CACHE STRING "llvm-objcopy (for native object files like elf)")
9393
set(LLVM_CONFIG "" CACHE STRING "llvm-config utility for setting up library paths")
94-
set(DRAGONEGG "" CACHE STRING "DRAGONEGG plugin path")
95-
set(DRAGONEGG_GCC "" CACHE STRING "DRAGONEGG enabled gcc")
96-
set(DRAGONEGG_FC "" CACHE STRING "DRAGONEGG enabled Fortran compiler")
97-
set(DRAGONEGG_LLVM_LINK "" CACHE STRING "llvm-link compatible with the DRAGONEGG LLVM version")
98-
set(DRAGONEGG_LLVMAS "" CACHE STRING "llvm-as compatible with the DRAGONEGG LLVM version")
99-
# not set by default
100-
set(TOOLCHAIN_CLANG "" CACHE STRING "Toolchain Wrapper for clang used by the 'bitcode' variant")
101-
set(TOOLCHAIN_CLANGXX "" CACHE STRING "Toolchain Wrapper for clang++ used by the 'bitcode' variant")
10294

10395
if(WIN32)
10496
# On Windows this defaults to 260 and produces a lot of warnings

Diff for: sulong/tests/com.oracle.truffle.llvm.tests.cmake/SulongTestSuiteVariantExecutable.cmake

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2025, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -38,29 +38,10 @@ macro(setupCompiler)
3838
setCompilerConfig(CMAKE_CXX_COMPILER ${CLANGXX})
3939
# reset in order to create a log message
4040
setCompilerConfig(LLVM_OBJCOPY ${LLVM_OBJCOPY})
41-
if("Fortran" IN_LIST SULONG_ENABLED_LANGUAGES)
42-
requireVariable(DRAGONEGG)
43-
requireVariable(DRAGONEGG_FC)
44-
setCompilerConfig(DRAGONEGG_FC ${DRAGONEGG_FC})
45-
setCompilerConfig(DRAGONEGG ${DRAGONEGG})
46-
setCompilerConfig(CMAKE_Fortran_COMPILER ${DRAGONEGG_FC})
47-
endif()
4841
endmacro()
4942

5043
macro(targetPostProcess SOURCE TARGET OUTPUT_DIR OUTPUT)
5144
get_source_file_property(TARGET_LANG ${SOURCE} LANGUAGE)
52-
if(${TARGET_LANG} STREQUAL "Fortran")
53-
set(TARGET_LL "${TARGET}.dragonegg.ll")
54-
# create a bitcode target
55-
add_library(${TARGET_LL} STATIC ${SOURCE})
56-
target_compile_options(${TARGET_LL} PRIVATE "-S" "-fplugin=${DRAGONEGG}" "-fplugin-arg-dragonegg-emit-ir")
57-
set_target_properties(${TARGET_LL} PROPERTIES Fortran_MODULE_DIRECTORY ${OUTPUT_DIR}/${OUTPUT}.dragonegg.ll.mod)
58-
# postprocess to add the bitcode to the target file via objcopy
59-
add_custom_command(
60-
TARGET ${TARGET} POST_BUILD
61-
COMMAND ${LLVM_OBJCOPY} "--add-section" ".llvmbc=$<TARGET_FILE:${TARGET_LL}>" "$<TARGET_FILE:${TARGET}>"
62-
)
63-
endif()
6445
endmacro()
6546

6647
macro(setupOptions)

0 commit comments

Comments
 (0)