Index: External/CMakeLists.txt =================================================================== --- External/CMakeLists.txt +++ External/CMakeLists.txt @@ -2,5 +2,6 @@ HMMER Nurbs Povray + SPEC skidmarks10 ) Index: External/SPEC/CFP2000/177.mesa/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CFP2000/177.mesa/CMakeLists.txt @@ -0,0 +1,90 @@ +# There's more files than we need in the src directory, provide a list: +set(SourceNames + accum.c + alpha.c + alphabuf.c + api1.c + api2.c + attrib.c + bitmap.c + blend.c + clip.c + colortab.c + context.c + copypix.c + depth.c + dlist.c + drawpix.c + enable.c + eval.c + feedback.c + fog.c + get.c + hash.c + image.c + light.c + lines.c + logic.c + masking.c + matrix.c + misc.c + mmath.c + osmesa.c + pb.c + pixel.c + pointers.c + points.c + polygon.c + quads.c + rastpos.c + readpix.c + rect.c + scissor.c + shade.c + span.c + stencil.c + teximage.c + texobj.c + texstate.c + texture.c + triangle.c + varray.c + vb.c + vbfill.c + vbrender.c + vbxform.c + winpos.c + xform.c + mesa4.c +) +set(Source "") +foreach(Filename ${SourceNames}) + list(APPEND Source ${SOURCE_DIR}/src/${Filename}) +endforeach() + +macro(test_input run_type frames) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input + -frames ${frames} -meshfile mesa.in -ppmfile mesa.ppm + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/mesa.log + ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/mesa.log + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -a 6.0 + ${SOURCE_DIR}/data/${run_type}/output/mesa.ppm + ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/mesa.ppm + ) +endmacro() + +test_input(test 10) +test_input(train 500) +test_input(ref 1000) + +llvm_multisource() + +# The benchmark writes the output where the input files are, so we have to +# copy the data over. +include(CopyDir) +llvm_copy_dir(177.mesa ${SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data) Index: External/SPEC/CFP2000/179.art/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CFP2000/179.art/CMakeLists.txt @@ -0,0 +1,58 @@ +macro(test_input run_type output) + llvm_test_run(RUN_TYPE ${run_type} ${ARGN} > "${CMAKE_CURRENT_BINARY_DIR}/${output}") + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -r 0.01 + "${SOURCE_DIR}/data/${run_type}/output/${output}" + "${CMAKE_CURRENT_BINARY_DIR}/${output}" + ) +endmacro() + +set(DATADIR ${SOURCE_DIR}/data) +test_input(test test.out + WORKDIR ${DATADIR}/test/input + -scanfile c756hel.in + -trainfile1 a10.img + -stride 2 + -startx 134 + -starty 220 + -endx 139 + -endy 225 + -objects 1 +) +test_input(train train.out + WORKDIR ${DATADIR}/train/input + -scanfile c756hel.in + -trainfile1 a10.img + -stride 2 + -startx 134 + -starty 220 + -endx 184 + -endy 240 + -objects 3 +) +test_input(ref ref.1.out + WORKDIR ${DATADIR}/ref/input + -scanfile c756hel.in + -trainfile1 a10.img + -trainfile2 hc.img + -stride 2 + -startx 110 + -starty 200 + -endx 160 + -endy 240 + -objects 10 +) +test_input(ref ref.2.out + WORKDIR ${DATADIR}/ref/input + -scanfile c756hel.in + -trainfile1 a10.img + -trainfile2 hc.img + -stride 2 + -startx 470 + -starty 140 + -endx 520 + -endy 180 + -objects 10 +) + +llvm_multisource() Index: External/SPEC/CFP2000/183.equake/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CFP2000/183.equake/CMakeLists.txt @@ -0,0 +1,17 @@ +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} + < "${SOURCE_DIR}/data/${run_type}/input/inp.in" + > "${CMAKE_CURRENT_BINARY_DIR}/inp.out" + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -r 0.00001 + "${SOURCE_DIR}/data/${run_type}/output/inp.out" + "${CMAKE_CURRENT_BINARY_DIR}/inp.out" + ) +endmacro() + +test_input(test) +test_input(train) +test_input(ref) + +llvm_multisource() Index: External/SPEC/CFP2000/188.ammp/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CFP2000/188.ammp/CMakeLists.txt @@ -0,0 +1,18 @@ +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${SOURCE_DIR}/data/${run_type}/input + < ${SOURCE_DIR}/data/${run_type}/input/ammp.in + > "${CMAKE_CURRENT_BINARY_DIR}/ammp.out" + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -r 0.003 -a 0.0001 + "${SOURCE_DIR}/data/${run_type}/output/ammp.out" + "${CMAKE_CURRENT_BINARY_DIR}/ammp.out" + ) +endmacro() + +test_input(test) +test_input(train) +test_input(ref) + +llvm_multisource() Index: External/SPEC/CFP2000/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CFP2000/CMakeLists.txt @@ -0,0 +1,23 @@ +list(APPEND CPPFLAGS -DSPEC_CPU2000) +if(ARCH_LP64) + list(APPEND CPPFLAGS -DSPEC_CPU2000_LP64) +endif() + +macro(cfp2000_subdir) + foreach(BENCHMARK ${ARGN}) + set(SOURCE_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CFP2000/${BENCHMARK}) + set(PROG ${BENCHMARK}) + file(GLOB Source ${SOURCE_DIR}/src/*.c ${SOURCE_DIR}/src/*.cpp) + if(NOT DEFINED RUN_TYPE) + set(RUN_TYPE "train") + endif() + llvm_add_subdirectories(${BENCHMARK}) + endforeach() +endmacro() + +cfp2000_subdir( + 177.mesa + 179.art + 183.equake + 188.ammp +) Index: External/SPEC/CINT2000/164.gzip/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/164.gzip/CMakeLists.txt @@ -0,0 +1,21 @@ +macro(test_input run_type filename size) + llvm_test_run(RUN_TYPE ${run_type} + ${SOURCE_DIR}/data/${run_type}/input/${filename} + ${size} + > ${CMAKE_CURRENT_BINARY_DIR}/${filename}.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/${filename}.out + ${CMAKE_CURRENT_BINARY_DIR}/${filename}.out + ) +endmacro() + +test_input(train input.combined 32) +test_input(test input.compressed 2) +test_input(ref input.source 60) +test_input(ref input.log 60) +test_input(ref input.graphic 60) +test_input(ref input.random 60) +test_input(ref input.program 60) + +llvm_multisource() Index: External/SPEC/CINT2000/175.vpr/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/175.vpr/CMakeLists.txt @@ -0,0 +1,36 @@ +list(APPEND CPPFLAGS -DNO_GRAPHICSS) +list(APPEND LDFLAGS -lm) + +macro(test_input run_type costs_tolerance) + set(COSTS_OUT ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/costs.out) + # The benchmark keeps appending to costs.out, so we have to make sure there + # is none from previous runs + llvm_test_run(RUN_TYPE ${run_type} EXECUTABLE rm ${COSTS_OUT}) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input + net.in arch.in place.out dum.out + -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 + > ${CMAKE_CURRENT_BINARY_DIR}/place_log.out + ) +llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp ${SOURCE_DIR}/data/${run_type}/output/place_log.out ${CMAKE_CURRENT_BINARY_DIR}/place_log.out) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input + net.in arch.in place.in route.out + -nodisp -route_only -route_chan_width 15 -pres_fac_mult 2 -acc_fac 1 -first_iter_pres_fac 4 -initial_pres_fac 8 + > ${CMAKE_CURRENT_BINARY_DIR}/route_log.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp -r 0.015 ${SOURCE_DIR}/data/${run_type}/output/route_log.out ${CMAKE_CURRENT_BINARY_DIR}/route_log.out) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp -r 0.015 ${SOURCE_DIR}/data/${run_type}/output/route.out ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/route.out) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp -r ${costs_tolerance} ${SOURCE_DIR}/data/${run_type}/output/costs.out ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/costs.out) +endmacro() + +test_input(ref 0.05) +test_input(train 0.05) +test_input(test 0.10) + +llvm_multisource() + +# The benchmark writes the output where the input files are, so we have to +# copy the data over. +include(CopyDir) +llvm_copy_dir(175.vpr ${SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data) Index: External/SPEC/CINT2000/176.gcc/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/176.gcc/CMakeLists.txt @@ -0,0 +1,27 @@ +if(ENDIAN STREQUAL "big") + list(APPEND CPPFLAGS -DHOST_WORDS_BIG_ENDIAN) +endif() +if(TARGET_OS STREQUAL "Darwin") + list(APPEND LDFLAGS -Xlinker -stack_size -Xlinker 0x800000) +endif() + +macro(test_input run_type ifile sfile) + llvm_test_run(RUN_TYPE ${run_type} + ${SOURCE_DIR}/data/${run_type}/input/${ifile} + -o ${CMAKE_CURRENT_BINARY_DIR}/${sfile} + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/${sfile} + ${CMAKE_CURRENT_BINARY_DIR}/${sfile} + ) +endmacro() + +test_input(ref 166.i 166.s) +test_input(ref 200.i 200.s) +test_input(ref expr.i expr.s) +test_input(ref integrate.i integrate.s) +test_input(ref scilab.i scilab.s) +test_input(train cp-decl.i cp-decl.s) +test_input(test cccp.i cccp.s) + +llvm_multisource() Index: External/SPEC/CINT2000/181.mcf/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/181.mcf/CMakeLists.txt @@ -0,0 +1,20 @@ +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} + ${SOURCE_DIR}/data/${run_type}/input/inp.in + > ${CMAKE_CURRENT_BINARY_DIR}/inp.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/mcf.out + ${CMAKE_CURRENT_BINARY_DIR}/mcf.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/inp.out + ${CMAKE_CURRENT_BINARY_DIR}/inp.out + ) +endmacro() + +test_input(ref) +test_input(train) +test_input(test) + +llvm_multisource() Index: External/SPEC/CINT2000/186.crafty/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/186.crafty/CMakeLists.txt @@ -0,0 +1,44 @@ +if(ARCH STREQUAL "Alpha") + list(APPEND CPPFLAGS -DALPHA -DLINUX) +elseif(ARCH STREQUAL "PowerPC") + list(APPEND CPPFLAGS -DLINUX_PPC32) +elseif(ARCH STREQUAL "Sparc") + list(APPEND CPPFLAGS -DSUN_BSD) +endif() + +if(TARGET_OS STREQUAL "Darwin") + list(APPEND CPPFLAGS -DUNIX -DLINUX) +elseif(TARGET_OS STREQUAL "Linux") + list(APPEND CPPFLAGS -DUNIX -DLINUX) +endif() + +if(ENDIAN STREQUAL "little") + list(APPEND CPPFLAGS -DLITTLE_ENDIAN_ARCH) +endif() + +include(CheckTypeSize) +check_type_size("long" LONG64_TYPE_SIZE BUILTIN_TYPES_ONLY) +if(LONG64_TYPE_SIZE EQUAL 8) + list(APPEND CPPFLAGS -DLONG_HAS_64BITS) +endif() +check_type_size("long long" LONG_LONG_TYPE_SIZE BUILTIN_TYPES_ONLY) +if(LONG_LONG_TYPE_SIZE GREATER 7) + list(APPEND CPPFLAGS -DHAS_LONGLONG) +endif() + +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} + < ${SOURCE_DIR}/data/${run_type}/input/crafty.in + > ${CMAKE_CURRENT_BINARY_DIR}/crafty.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/crafty.out + ${CMAKE_CURRENT_BINARY_DIR}/crafty.out + ) +endmacro() + +test_input(ref) +test_input(train) +test_input(test) + +llvm_multisource() Index: External/SPEC/CINT2000/197.parser/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/197.parser/CMakeLists.txt @@ -0,0 +1,23 @@ +if(TARGET_OS STREQUAL "Darwin") + list(APPEND CPPFLAGS -D_ANSI_SOURCE=1) +endif() + +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} WORKDIR ${SOURCE_DIR}/data/all/input + 2.1.dict -batch + < ${SOURCE_DIR}/data/${run_type}/input/${run_type}.in + > ${CMAKE_CURRENT_BINARY_DIR}/${run_type}.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/${run_type}.out + ${CMAKE_CURRENT_BINARY_DIR}/${run_type}.out + ) +endmacro() + +test_input(ref) +test_input(train) +test_input(test) + +llvm_multisource() + +#copy_dir(197.parser ${CMAKE_CURRENT_BINARY_DIR}/197.parser.test ${SOURCE_DIR}/data/all/input ${CMAKE_CURRENT_BINARY_DIR}) Index: External/SPEC/CINT2000/252.eon/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/252.eon/CMakeLists.txt @@ -0,0 +1,188 @@ +list(APPEND CPPFLAGS -include errno.h -DHAS_ERRLIST -DUSE_STRERROR -DSPEC_STDCPP) +if(ARCH STREQUAL "PowerPC") + list(APPEND CPPFLAGS -DFMAX_IS_DOUBLE) +endif() +list(APPEND CXXFLAGS -fno-exceptions -Wno-deprecated -fpermissive -stdlib=libstdc++) +list(APPEND LDFLAGS -stdlib=libstdc++ -lm) +list(APPEND LIBS -lm) +include_directories(${SOURCE_DIR}/src) + +# There's more sourcefiles in the directory than necessary so enumerate the ones +# we want. +set(SourceNames + ggCoverageSolidTexture.cc + ggPathDielectricMaterial.cc + ggBox2.cc + ggBox3.cc + ggRasterSurfaceTexture.cc + ggJitterSample1.cc + ggNRooksSample2.cc + ggJitterSample2.cc + ggRGBFPixel.cc + ggRotatingPinholeCamera.cc + ggRandomSample2.cc + ggRandomSample3.cc + ggSolidNoise2.cc + ggSolidNoise3.cc + ggSolidTexture.cc + ggOakSolidTexture.cc + ggSpecularMaterial.cc + ggNA.cc + ggMaterial.cc + ggDiffuseMaterial.cc + ggDielectricMaterial.cc + ggConductorMaterial.cc + ggEdgeDiscrepancy.cc + ggPolishedMaterial.cc + ggFrameInterpolation.cc + ggQuaternion.cc + ggSpline.cc + ggONB2.cc + ggONB3.cc + ggFrame2.cc + ggFrame3.cc + ggHMatrix3.cc + ggSphere.cc + ggRGBE.cc + ggGamma.cc + ggBRDF.cc + ggDiffuseBRDF.cc + ggPhongBRDF.cc + ggPolishedBRDF.cc + ggCamera.cc + ggPinholeCamera.cc + ggThinLensCamera.cc + ggErr.cc + ggPixelFilter.cc + ggTrianglePixelFilter.cc + ggBoxPixelFilter.cc + ggFormat.cc + ggGeometry.cc + ggHAffineMatrix3.cc + ggHShearMatrix3.cc + ggHBoxMatrix3.cc + ggHPerspectiveMatrix3.cc + ggHTranslationMatrix3.cc + ggHRigidBodyMatrix3.cc + ggHRotationMatrix3.cc + ggHScaleMatrix3.cc + ggHPoint3.cc + ggPoint2.cc + ggPoint3.cc + ggOptics.cc + ggPlane.cc + ggPolygon.cc + ggGrayPixel_x.cc + ggRGBPixel_x.cc + ggRay2.cc + ggRay3.cc + ggBoardFloorSolidTexture.cc + ggVector2.cc + ggVector3.cc + ggString.cc + ggFineSpectrum.cc + ggSpectrum.cc + eon.cc + eonImageCalculator.cc + mrObjectRecord.cc + mrCoarsePixelRenderer.cc + mrIndirectPixelRenderer.cc + mrRushmeierPixelRenderer.cc + mrBruteForcePixelRenderer.cc + mrKajiyaPixelRenderer.cc + mrCookPixelRenderer.cc + mrGrid.cc + mrScene.cc + mrCamera.cc + mrTriangle.cc + mrFastTriangle.cc + mrPolygon.cc + mrXYDisk.cc + mrXZDisk.cc + mrYZDisk.cc + mrPhongAreaXYRectangleLuminaire.cc + mrPhongAreaXZRectangleLuminaire.cc + mrPhongAreaYZRectangleLuminaire.cc + mrEmitter.cc + mrImposter.cc + mrLinkedObjects.cc + mrBox.cc + mrXCylinder.cc + mrYCylinder.cc + mrZCylinder.cc + mrDiffuseAreaZCylinderLuminaire.cc + mrDiffuseCosineZCylinderLuminaire.cc + mrDiffuseVisibleAreaZCylinderLuminaire.cc + mrXEllipticalCylinder.cc + mrYEllipticalCylinder.cc + mrZEllipticalCylinder.cc + mrSpotAreaXYDiskLuminaire.cc + mrDiffuseAreaXYRectangleLuminaire.cc + mrDiffuseAreaXZRectangleLuminaire.cc + mrDiffuseAreaYZRectangleLuminaire.cc + mrSurfaceList.cc + mrDiffuseAreaTriangleLuminaire.cc + mrDiffuseAreaSphereLuminaire.cc + mrDiffuseCosineSphereLuminaire.cc + mrDiffuseSolidAngleSphereLuminaire.cc + mrShellLuminaire.cc + mrInstance.cc + mrMaterial.cc + mrPhongAreaTriangleLuminaire.cc + mrSolidTexture.cc + mrSphere.cc + mrSurface.cc + mrSurfaceTexture.cc + mrXYRectangle.cc + mrXZRectangle.cc + mrYZRectangle.cc + myrand.cc +) +set(Source "") +foreach(FILENAME ${SourceNames}) + list(APPEND Source ${SOURCE_DIR}/src/${FILENAME}) +endforeach() + +macro(test_input run_type) + set(INPUT_DIR "${SOURCE_DIR}/data/${run_type}/input") + llvm_test_run(RUN_TYPE ${run_type} WORKDIR ${INPUT_DIR} + chair.control.cook chair.camera chair.surfaces + ${CMAKE_CURRENT_BINARY_DIR}/chair.cook.ppm + ppm + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.cook + ) + llvm_test_run(RUN_TYPE ${run_type} WORKDIR ${INPUT_DIR} + chair.control.rushmeier chair.camera chair.surfaces + ${CMAKE_CURRENT_BINARY_DIR}/chair.rushmeier.ppm + ppm + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.rushmeier + ) + llvm_test_run(RUN_TYPE ${run_type} WORKDIR ${INPUT_DIR} + chair.control.kajiya chair.camera chair.surfaces + ${CMAKE_CURRENT_BINARY_DIR}/chair.kajiya.ppm + ppm + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.kajiya + ) + + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -a 0.005 + ${SOURCE_DIR}/data/${run_type}/output/pixels_out.cook + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.cook + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -a 0.005 + ${SOURCE_DIR}/data/${run_type}/output/pixels_out.rushmeier + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.rushmeier + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -a 0.005 + ${SOURCE_DIR}/data/${run_type}/output/pixels_out.kajiya + ${CMAKE_CURRENT_BINARY_DIR}/pixels_out.kajiya + ) +endmacro() + +test_input(ref) +test_input(train) +test_input(test) + +llvm_multisource() Index: External/SPEC/CINT2000/254.gap/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/254.gap/CMakeLists.txt @@ -0,0 +1,31 @@ +# We need to include unistd.h because something with Fedora Core 1 is broken, +# and we need the sysconf() macros. +list(APPEND CPPFLAGS -include unistd.h -DSYS_HAS_CALLOC_PROTO -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -DSYS_HAS_READ_PROTO) + +if(TARGET_OS STREQUAL "Darwin") + list(APPEND CPPFLAGS -DSYS_IS_BSD) +else() + list(APPEND CPPFLAGS -DSYS_IS_USG) +endif() + +# 254.gap relies on signed arithmetic overflow being well-defined. +LIST(APPEND CFLAGS -fwrapv) + +macro(test_input run_type heapsize) + llvm_test_run(RUN_TYPE ${run_type} + -l ${SOURCE_DIR}/data/all/input -q -m ${heapsize} + < ${SOURCE_DIR}/data/${run_type}/input/${run_type}.in + > ${CMAKE_CURRENT_BINARY_DIR}/${run_type}.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + -r 0.01 + ${SOURCE_DIR}/data/${run_type}/output/${run_type}.out + ${CMAKE_CURRENT_BINARY_DIR}/${run_type}.out + ) +endmacro() + +test_input(ref 192M) +test_input(train 128M) +test_input(test 64M) + +llvm_multisource() Index: External/SPEC/CINT2000/255.vortex/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/255.vortex/CMakeLists.txt @@ -0,0 +1,31 @@ +macro(test_input run_type input outfile) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input + ${input} + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/${outfile} + ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${outfile} + ) +endmacro() + +include(TestBigEndian) +test_big_endian(IS_BIGENDIAN) +if(IS_BIGENDIAN) + set(endianname "bendian") +else() + set(endianname "lendian") +endif() + +test_input(test "${endianname}.raw" vortex.out) +test_input(train "${endianname}.raw" vortex.out) +test_input(ref "${endianname}1.raw" vortex1.out) +test_input(ref "${endianname}2.raw" vortex2.out) +test_input(ref "${endianname}3.raw" vortex3.out) + +llvm_multisource() + +# The benchmark writes the output where the input files are, so we have to +# copy the data over. +include(CopyDir) +llvm_copy_dir(255.vortex ${SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data) Index: External/SPEC/CINT2000/256.bzip2/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/256.bzip2/CMakeLists.txt @@ -0,0 +1,19 @@ +macro(test_input run_type filename size) + llvm_test_run(RUN_TYPE ${run_type} + ${SOURCE_DIR}/data/${run_type}/input/${filename} + ${size} + > ${CMAKE_CURRENT_BINARY_DIR}/${filename}.out + ) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${SOURCE_DIR}/data/${run_type}/output/${filename}.out + ${CMAKE_CURRENT_BINARY_DIR}/${filename}.out + ) +endmacro() + +test_input(train input.compressed 8) +test_input(test input.random 2) +test_input(ref input.source 58) +test_input(ref input.graphic 58) +test_input(ref input.program 58) + +llvm_multisource() Index: External/SPEC/CINT2000/300.twolf/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/300.twolf/CMakeLists.txt @@ -0,0 +1,27 @@ +list(APPEND LDFLAGS -lm) +list(APPEND CFLAGS -Wno-return-type) + +macro(test_input run_type) + llvm_test_run(RUN_TYPE ${run_type} + WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input + ${run_type} + > ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${run_type}.stdout + ) + foreach(file IN ITEMS ${run_type}.twf ${run_type}.pl2 ${run_type}.sav ${run_type}.pl1 ${run_type}.pl1 ${run_type}.pin ${run_type}.stdout ${run_type}.sv2 ${run_type}.out) + llvm_test_verify(RUN_TYPE ${run_type} ${CMAKE_BINARY_DIR}/tools/fpcmp + ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${file} + ${SOURCE_DIR}/data/${run_type}/output/${file} + ) + endforeach() +endmacro() + +test_input(test) +test_input(train) +test_input(ref) + +llvm_multisource() + +# The benchmark writes the output where the input files are, so we have to +# copy the data over. +include(CopyDir) +llvm_copy_dir(300.twolf ${SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data) Index: External/SPEC/CINT2000/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CINT2000/CMakeLists.txt @@ -0,0 +1,30 @@ +list(APPEND CPPFLAGS -DSPEC_CPU2000) +if(ARCH_LP64) + list(APPEND CPPFLAGS -DSPEC_CPU2000_LP64) +endif() + +macro(cint2000_subdir) + foreach(BENCHMARK ${ARGN}) + set(SOURCE_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CINT2000/${BENCHMARK}) + set(PROG ${BENCHMARK}) + file(GLOB Source ${SOURCE_DIR}/src/*.c ${SOURCE_DIR}/src/*.cpp) + if(NOT DEFINED RUN_TYPE) + set(RUN_TYPE "train") + endif() + llvm_add_subdirectories(${BENCHMARK}) + endforeach() +endmacro() + +cint2000_subdir( + 164.gzip + 175.vpr + 176.gcc + 181.mcf + 186.crafty + 197.parser + 252.eon + 254.gap + 255.vortex + 256.bzip2 + 300.twolf +) Index: External/SPEC/CMakeLists.txt =================================================================== --- /dev/null +++ External/SPEC/CMakeLists.txt @@ -0,0 +1,6 @@ +set(TEST_SUITE_SPEC2000_ROOT "${TEST_SUITE_EXTERNALS_DIR}/speccpu2000" CACHE PATH "Directory containing a SPEC 2000 installation") + +llvm_add_subdirectories( + CFP2000 + CINT2000 +) Index: cmake/modules/CopyDir.cmake =================================================================== --- /dev/null +++ cmake/modules/CopyDir.cmake @@ -0,0 +1,7 @@ +# Copy over data common to all test inputs +macro(llvm_copy_dir target from to) + add_custom_command( + TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${from} ${to} + ) +endmacro()