diff --git a/configure.ac b/configure.ac index 5daa1572..d9b59051 100644 --- a/configure.ac +++ b/configure.ac @@ -51,22 +51,10 @@ AC_CONFIG_FILES([ Makefile lib/Makefile src/Makefile + src/sat/Makefile + src/optck/Makefile + src/optfe/Makefile test/Makefile test/lit.cfg ]) -AC_CONFIG_LINKS([ - bin/stack/gcc:test/gcc - bin/stack/g++:test/gcc - bin/stack/cc:test/gcc - bin/stack/c++:test/gcc - bin/stack/cc1:test/cc1 - bin/stack/clang:test/gcc - bin/stack/clang++:test/gcc - bin/stack/arm-linux-gnueabi-gcc:test/arm-linux-gnueabi-gcc - bin/stack/arm-linux-gnueabi-g++:test/arm-linux-gnueabi-g++ - bin/stack-build:test/stack-build - bin/ncpu:src/ncpu - bin/optck:src/optck - bin/poptck:src/poptck -]) AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am index 0274ca3c..60b22c1d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ BOOLECTOR = boolector-1.5.116-eeaf10b-121004 LINGELING = lingeling-al6-080d45d-120922 -EXTRA_DIST = $(BOOLECTOR).tar.gz $(LINGELING).tar.gz +EXTRA_DIST = $(BOOLECTOR).tar.gz $(LINGELING).tar.gz lit if HAVE_BOOLECTOR all-local: libboolector.a diff --git a/src/Makefile.am b/src/Makefile.am index a7cb0b29..0b9d0213 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,41 +1 @@ -AM_CXXFLAGS = `llvm-config --cxxflags` -Werror -Wall -std=c++11 -fno-strict-aliasing - -noinst_LTLIBRARIES = libsat.la -lib_LTLIBRARIES = liboptck.la liboptfe.la -EXTRA_DIST = optck poptck ncpu - -all-local: liboptck.la liboptfe.la - @cd $(top_builddir)/lib && $(LN_S) -f ../src/.libs/liboptck.so - @cd $(top_builddir)/lib && $(LN_S) -f ../src/.libs/liboptfe.so - -libsat_la_CPPFLAGS = -I$(top_builddir)/lib -libsat_la_SOURCES = ValueGen.cc PathGen.cc Diagnostic.cc SMTSolver.cc -libsat_la_SOURCES += PHIRange.cc LoopPrepare.cc ElimAssert.cc -libsat_la_SOURCES += BugOn.cc BugOnInt.cc BugOnNull.cc BugOnGep.cc -libsat_la_SOURCES += BugOnAlias.cc BugOnFree.cc BugOnBounds.cc BugOnUndef.cc -libsat_la_SOURCES += BugOnLoop.cc BugOnAssert.cc -libsat_la_SOURCES += BugOnLibc.cc BugOnLinux.cc -libsat_la_SOURCES += ValueGen.h PathGen.h Diagnostic.h SMTSolver.h BugOn.h -libsat_la_SOURCES += GlobalTimeout.cc -if HAVE_SMTLIB -libsat_la_SOURCES += SMTLIB.cc -libsat_la_LIBADD = -lutil -endif -if HAVE_BOOLECTOR -libsat_la_SOURCES += SMTBoolector.cc -libsat_la_LIBADD = -lboolector -llgl -endif -#libsat_la_SOURCES += SMTSonolar.cc -#libsat_la_LIBADD = -lsonolar -#libsat_la_SOURCES += SMTZ3.cc -#libsat_la_LIBADD = -lz3 -lgomp -libsat_la_LDFLAGS = -L$(top_builddir)/lib - -liboptck_la_SOURCES = AntiFunctionPass.cc AntiDCE.cc AntiAlgebra.cc AntiSimplify.cc -liboptck_la_SOURCES += InlineOnly.cc SimplifyDelete.cc IgnoreLoopInitial.cc LoadElim.cc -liboptck_la_SOURCES += AntiFunctionPass.h -liboptck_la_LIBADD = libsat.la -liboptck_la_LDFLAGS = -module - -liboptfe_la_SOURCES = IntAction.cc -liboptfe_la_LDFLAGS = -module +SUBDIRS = sat optck optfe diff --git a/src/AntiAlgebra.cc b/src/optck/AntiAlgebra.cc similarity index 100% rename from src/AntiAlgebra.cc rename to src/optck/AntiAlgebra.cc diff --git a/src/AntiDCE.cc b/src/optck/AntiDCE.cc similarity index 100% rename from src/AntiDCE.cc rename to src/optck/AntiDCE.cc diff --git a/src/AntiFunctionPass.cc b/src/optck/AntiFunctionPass.cc similarity index 100% rename from src/AntiFunctionPass.cc rename to src/optck/AntiFunctionPass.cc diff --git a/src/AntiFunctionPass.h b/src/optck/AntiFunctionPass.h similarity index 91% rename from src/AntiFunctionPass.h rename to src/optck/AntiFunctionPass.h index 74cff9df..0ea9c179 100644 --- a/src/AntiFunctionPass.h +++ b/src/optck/AntiFunctionPass.h @@ -1,9 +1,9 @@ #pragma once -#include "BugOn.h" -#include "Diagnostic.h" -#include "PathGen.h" -#include "ValueGen.h" +#include "sat/BugOn.h" +#include "sat/Diagnostic.h" +#include "sat/PathGen.h" +#include "sat/ValueGen.h" #include #include #include diff --git a/src/AntiSimplify.cc b/src/optck/AntiSimplify.cc similarity index 100% rename from src/AntiSimplify.cc rename to src/optck/AntiSimplify.cc diff --git a/src/IgnoreLoopInitial.cc b/src/optck/IgnoreLoopInitial.cc similarity index 100% rename from src/IgnoreLoopInitial.cc rename to src/optck/IgnoreLoopInitial.cc diff --git a/src/InlineOnly.cc b/src/optck/InlineOnly.cc similarity index 100% rename from src/InlineOnly.cc rename to src/optck/InlineOnly.cc diff --git a/src/LoadElim.cc b/src/optck/LoadElim.cc similarity index 100% rename from src/LoadElim.cc rename to src/optck/LoadElim.cc diff --git a/src/optck/Makefile.am b/src/optck/Makefile.am new file mode 100644 index 00000000..3d85eb4c --- /dev/null +++ b/src/optck/Makefile.am @@ -0,0 +1,25 @@ +bin_SCRIPTS=\ + ncpu\ + optck\ + poptck + +lib_LTLIBRARIES = liboptck.la + +EXTRA_DIST = optck.in poptck ncpu + +MOSTLYCLEANFILES=optck +optck: Makefile.am optck.in + sed \ + -e 's|[@]libdir[@]|$(libdir)|g'\ + -e 's|[@]bindir[@]|$(bindir)|g'\ + $(srcdir)/optck.in > $@ + chmod u+x $@ + +liboptck_la_CPPFLAGS = -I$(srcdir)/../ +liboptck_la_CXXFLAGS = `llvm-config --cxxflags` -Werror -Wall -std=c++11 -fno-strict-aliasing +liboptck_la_LIBADD = ../sat/libsat.la +liboptck_la_LDFLAGS = -module + +liboptck_la_SOURCES = AntiFunctionPass.cc AntiDCE.cc AntiAlgebra.cc AntiSimplify.cc +liboptck_la_SOURCES += InlineOnly.cc SimplifyDelete.cc IgnoreLoopInitial.cc LoadElim.cc +liboptck_la_SOURCES += AntiFunctionPass.h diff --git a/src/SimplifyDelete.cc b/src/optck/SimplifyDelete.cc similarity index 99% rename from src/SimplifyDelete.cc rename to src/optck/SimplifyDelete.cc index bc90a7f3..62432050 100644 --- a/src/SimplifyDelete.cc +++ b/src/optck/SimplifyDelete.cc @@ -2,7 +2,7 @@ // for C++ delete. #define DEBUG_TYPE "simplify-delete" -#include "BugOn.h" +#include "sat/BugOn.h" #include #include #include diff --git a/src/ncpu b/src/optck/ncpu similarity index 100% rename from src/ncpu rename to src/optck/ncpu diff --git a/src/optck b/src/optck/optck.in similarity index 69% rename from src/optck rename to src/optck/optck.in index 83054d9a..9acbaa25 100755 --- a/src/optck +++ b/src/optck/optck.in @@ -1,8 +1,16 @@ #!/usr/bin/env bash -DIR=$(dirname "${BASH_SOURCE[0]}") +DIR="$(dirname "${BASH_SOURCE[0]}" && pwd)" OPT="`llvm-config --bindir`/opt" -exec ${OPT} --disable-output -load=${DIR}/../lib/liboptck.so \ + +LIBDIR='@libdir@/liboptck.so' + +if test ! "${DIR}" = "@bindir@" +then + LIBDIR="${DIR}/liboptck.so" +fi + +exec "${OPT}" --disable-output -load='@libdir@/liboptck.so' \ -targetlibinfo -tbaa -basicaa -globalopt -sccp -deadargelim \ -basiccg -prune-eh -simplify-delete -load-elim \ -inline-only -functionattrs -argpromotion \ diff --git a/src/poptck b/src/optck/poptck similarity index 100% rename from src/poptck rename to src/optck/poptck diff --git a/src/IntAction.cc b/src/optfe/IntAction.cc similarity index 100% rename from src/IntAction.cc rename to src/optfe/IntAction.cc diff --git a/src/optfe/Makefile.am b/src/optfe/Makefile.am new file mode 100644 index 00000000..0c183223 --- /dev/null +++ b/src/optfe/Makefile.am @@ -0,0 +1,6 @@ +lib_LTLIBRARIES = liboptfe.la + +liboptfe_la_CXXFLAGS = `llvm-config --cxxflags` -Werror -Wall -std=c++11 -fno-strict-aliasing +liboptfe_la_LDFLAGS = -module + +liboptfe_la_SOURCES = IntAction.cc diff --git a/src/BugOn.cc b/src/sat/BugOn.cc similarity index 100% rename from src/BugOn.cc rename to src/sat/BugOn.cc diff --git a/src/BugOn.h b/src/sat/BugOn.h similarity index 100% rename from src/BugOn.h rename to src/sat/BugOn.h diff --git a/src/BugOnAlias.cc b/src/sat/BugOnAlias.cc similarity index 100% rename from src/BugOnAlias.cc rename to src/sat/BugOnAlias.cc diff --git a/src/BugOnAssert.cc b/src/sat/BugOnAssert.cc similarity index 100% rename from src/BugOnAssert.cc rename to src/sat/BugOnAssert.cc diff --git a/src/BugOnBounds.cc b/src/sat/BugOnBounds.cc similarity index 100% rename from src/BugOnBounds.cc rename to src/sat/BugOnBounds.cc diff --git a/src/BugOnFree.cc b/src/sat/BugOnFree.cc similarity index 100% rename from src/BugOnFree.cc rename to src/sat/BugOnFree.cc diff --git a/src/BugOnGep.cc b/src/sat/BugOnGep.cc similarity index 100% rename from src/BugOnGep.cc rename to src/sat/BugOnGep.cc diff --git a/src/BugOnInt.cc b/src/sat/BugOnInt.cc similarity index 100% rename from src/BugOnInt.cc rename to src/sat/BugOnInt.cc diff --git a/src/BugOnLibc.cc b/src/sat/BugOnLibc.cc similarity index 100% rename from src/BugOnLibc.cc rename to src/sat/BugOnLibc.cc diff --git a/src/BugOnLinux.cc b/src/sat/BugOnLinux.cc similarity index 100% rename from src/BugOnLinux.cc rename to src/sat/BugOnLinux.cc diff --git a/src/BugOnLoop.cc b/src/sat/BugOnLoop.cc similarity index 100% rename from src/BugOnLoop.cc rename to src/sat/BugOnLoop.cc diff --git a/src/BugOnNull.cc b/src/sat/BugOnNull.cc similarity index 100% rename from src/BugOnNull.cc rename to src/sat/BugOnNull.cc diff --git a/src/BugOnUndef.cc b/src/sat/BugOnUndef.cc similarity index 100% rename from src/BugOnUndef.cc rename to src/sat/BugOnUndef.cc diff --git a/src/Diagnostic.cc b/src/sat/Diagnostic.cc similarity index 100% rename from src/Diagnostic.cc rename to src/sat/Diagnostic.cc diff --git a/src/Diagnostic.h b/src/sat/Diagnostic.h similarity index 100% rename from src/Diagnostic.h rename to src/sat/Diagnostic.h diff --git a/src/ElimAssert.cc b/src/sat/ElimAssert.cc similarity index 100% rename from src/ElimAssert.cc rename to src/sat/ElimAssert.cc diff --git a/src/GlobalTimeout.cc b/src/sat/GlobalTimeout.cc similarity index 100% rename from src/GlobalTimeout.cc rename to src/sat/GlobalTimeout.cc diff --git a/src/LoopPrepare.cc b/src/sat/LoopPrepare.cc similarity index 100% rename from src/LoopPrepare.cc rename to src/sat/LoopPrepare.cc diff --git a/src/sat/Makefile.am b/src/sat/Makefile.am new file mode 100644 index 00000000..acbaf414 --- /dev/null +++ b/src/sat/Makefile.am @@ -0,0 +1,28 @@ +noinst_LTLIBRARIES = libsat.la + +libsat_la_CXXFLAGS = `llvm-config --cxxflags` -Werror -Wall -std=c++11 -fno-strict-aliasing + +libsat_la_CPPFLAGS = -I$(top_builddir)/lib +libsat_la_SOURCES = ValueGen.cc PathGen.cc Diagnostic.cc SMTSolver.cc +libsat_la_SOURCES += PHIRange.cc LoopPrepare.cc ElimAssert.cc +libsat_la_SOURCES += BugOn.cc BugOnInt.cc BugOnNull.cc BugOnGep.cc +libsat_la_SOURCES += BugOnAlias.cc BugOnFree.cc BugOnBounds.cc BugOnUndef.cc +libsat_la_SOURCES += BugOnLoop.cc BugOnAssert.cc +libsat_la_SOURCES += BugOnLibc.cc BugOnLinux.cc +libsat_la_SOURCES += ValueGen.h PathGen.h Diagnostic.h SMTSolver.h BugOn.h +libsat_la_SOURCES += GlobalTimeout.cc + +if HAVE_SMTLIB +libsat_la_SOURCES += SMTLIB.cc +libsat_la_LIBADD = -lutil +endif +if HAVE_BOOLECTOR +libsat_la_SOURCES += SMTBoolector.cc +libsat_la_LIBADD = -lboolector -llgl +endif +#libsat_la_SOURCES += SMTSonolar.cc +#libsat_la_LIBADD = -lsonolar +#libsat_la_SOURCES += SMTZ3.cc +#libsat_la_LIBADD = -lz3 -lgomp + +libsat_la_LDFLAGS = -L$(top_builddir)/lib diff --git a/src/PHIRange.cc b/src/sat/PHIRange.cc similarity index 100% rename from src/PHIRange.cc rename to src/sat/PHIRange.cc diff --git a/src/PathGen.cc b/src/sat/PathGen.cc similarity index 100% rename from src/PathGen.cc rename to src/sat/PathGen.cc diff --git a/src/PathGen.h b/src/sat/PathGen.h similarity index 100% rename from src/PathGen.h rename to src/sat/PathGen.h diff --git a/src/SMTBoolector.cc b/src/sat/SMTBoolector.cc similarity index 100% rename from src/SMTBoolector.cc rename to src/sat/SMTBoolector.cc diff --git a/src/SMTLIB.cc b/src/sat/SMTLIB.cc similarity index 100% rename from src/SMTLIB.cc rename to src/sat/SMTLIB.cc diff --git a/src/SMTSolver.cc b/src/sat/SMTSolver.cc similarity index 100% rename from src/SMTSolver.cc rename to src/sat/SMTSolver.cc diff --git a/src/SMTSolver.h b/src/sat/SMTSolver.h similarity index 100% rename from src/SMTSolver.h rename to src/sat/SMTSolver.h diff --git a/src/SMTSonolar.cc b/src/sat/SMTSonolar.cc similarity index 100% rename from src/SMTSonolar.cc rename to src/sat/SMTSonolar.cc diff --git a/src/SMTZ3.cc b/src/sat/SMTZ3.cc similarity index 100% rename from src/SMTZ3.cc rename to src/sat/SMTZ3.cc diff --git a/src/ValueGen.cc b/src/sat/ValueGen.cc similarity index 100% rename from src/ValueGen.cc rename to src/sat/ValueGen.cc diff --git a/src/ValueGen.h b/src/sat/ValueGen.h similarity index 100% rename from src/ValueGen.h rename to src/sat/ValueGen.h diff --git a/test/Makefile.am b/test/Makefile.am index 63f4301e..4f91e651 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,47 @@ -EXTRA_DIST = lit.cfg.in cc1 diagdiff gcc g++ +EXTRA_DIST=\ + lit.cfg.in\ + cc1.in\ + diagdiff\ + stack-build.in\ + gcc arm-linux-gnueabi-gcc arm-linux-gnueabi-g++ + + +bin_SCRIPTS=stack-build +pkglibexec_SCRIPTS=\ + gcc\ + cc1\ + arm-linux-gnueabi-gcc\ + arm-linux-gnueabi-g++ + +MOSTLYCLEANFILES=stack-build cc1 +stack-build: Makefile.am stack-build.in + sed \ + -e 's|[@]pkglibexecdir[@]|$(pkglibexecdir)|g'\ + $(srcdir)/stack-build.in > $@ + +cc1: Makefile.am cc1.in + sed \ + -e 's|[@]libdir[@]|$(libdir)|g'\ + $(srcdir)/cc1.in > $@ + chmod u+x $@ + +install-exec-hook: + $(LN_S) -f $(DESTDIR)$(pkglibexecdir)/gcc$(EXEEXT)\ + $(DESTDIR)$(pkglibexecdir)/cc$(EXEEXT) + $(LN_S) -f $(DESTDIR)$(pkglibexecdir)/gcc$(EXEEXT)\ + $(DESTDIR)$(pkglibexecdir)/g++$(EXEEXT) + $(LN_S) -f $(DESTDIR)$(pkglibexecdir)/gcc$(EXEEXT)\ + $(DESTDIR)$(pkglibexecdir)/clang$(EXEEXT) + $(LN_S) -f $(DESTDIR)$(pkglibexecdir)/gcc$(EXEEXT)\ + $(DESTDIR)$(pkglibexecdir)/clang++$(EXEEXT) + +uninstall-hook: + - (cd $(DESTDIR)$(pkglibexecdir) && rm -f cc$(EXEEXT)) + - (cd $(DESTDIR)$(pkglibexecdir) && rm -f g++$(EXEEXT)) + - (cd $(DESTDIR)$(pkglibexecdir) && rm -f clang$(EXEEXT)) + - (cd $(DESTDIR)$(pkglibexecdir) && rm -f clang++$(EXEEXT)) LITFLAGS ?= -v -LITTESTS ?= $(builddir) +LITTESTS ?= $(builddir)/opt check-local: lit.cfg - @$(top_srcdir)/lib/lit/lit.py $(LITFLAGS) $(LITTESTS) + $(top_srcdir)/lib/lit/lit.py $(LITFLAGS) $(LITTESTS) diff --git a/test/cc1 b/test/cc1.in similarity index 97% rename from test/cc1 rename to test/cc1.in index a1bd368f..d55bc025 100755 --- a/test/cc1 +++ b/test/cc1.in @@ -4,6 +4,8 @@ import os import subprocess import sys +libdir = '@libdir@' + def cc(llvmcc, src, argv): out = [i for i, x in enumerate(argv) if x == '-o'] if not out: @@ -37,7 +39,7 @@ def cc(llvmcc, src, argv): # Additional options. more = ['-Qunused-arguments', '-w', '-S', '-flto', '-O0', '-g', '-D_FORTIFY_SOURCE=0'] # Frontend plugin. - intfe = os.path.join(os.path.dirname(__file__), '..', '..', 'lib', 'liboptfe.so') + intfe = os.path.join(libdir, 'liboptfe.so') plugin = ['-Xclang', '-load', '-Xclang', intfe, '-Xclang', '-plugin', '-Xclang', 'intfe'] p1 = subprocess.Popen(llvmcc + argv + more + plugin + [src], stdout=subprocess.PIPE) # Don't invoke -early-cse, which may hide undefined behavior bugs. diff --git a/test/lit.cfg.in b/test/lit.cfg.in index 1cf0f9ff..7de722a9 100644 --- a/test/lit.cfg.in +++ b/test/lit.cfg.in @@ -14,12 +14,19 @@ if 'LLVMCC' in os.environ: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() llvm_build_mode = lit.util.capture(['llvm-config', '--build-mode']).strip() llvm_bindir = os.path.join(llvm_obj_root, llvm_build_mode, 'bin') -stack_bindir = os.path.join("@abs_top_builddir@", 'bin') -path = os.path.pathsep.join( (stack_bindir, config.test_source_root, llvm_bindir, config.environment['PATH']) ) -config.environment['PATH'] = path -cc1 = os.path.join(stack_bindir, 'stack', 'cc1') +stack_srcdir = "@abs_top_srcdir@" +stack_builddir = "@abs_top_builddir@" + +cc1 = os.path.join(stack_builddir, 'test', 'cc1') cc = cc1 + ' -c -o -' linuxcc = cc1 + ' -nostdinc -fno-builtin -c -o -' + +optck = os.path.join(stack_builddir, 'src', 'optck', 'optck') +diagdiff = os.path.join(stack_srcdir, 'test', 'diagdiff') + config.substitutions.append( ('%cc', cc) ) config.substitutions.append( ('%linuxcc', linuxcc) ) + +config.substitutions.append( ('%optck', optck) ) +config.substitutions.append( ('%diagdiff', diagdiff) ) diff --git a/test/opt/add100.c b/test/opt/add100.c index ebda725a..36c5a290 100644 --- a/test/opt/add100.c +++ b/test/opt/add100.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s // // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475 diff --git a/test/opt/alias.c b/test/opt/alias.c index aa7e7e54..53b93dae 100644 --- a/test/opt/alias.c +++ b/test/opt/alias.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s #include diff --git a/test/opt/dead-loop.c b/test/opt/dead-loop.c index 6afe885b..d8671d9a 100644 --- a/test/opt/dead-loop.c +++ b/test/opt/dead-loop.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s // // From krb5, krb5_ccache_copy() in clients/ksu/ccache.c. diff --git a/test/opt/delete.cc b/test/opt/delete.cc index 9b8318f1..7c1844e5 100644 --- a/test/opt/delete.cc +++ b/test/opt/delete.cc @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s struct C { void f(); diff --git a/test/opt/ext4shl.c b/test/opt/ext4shl.c index 808e32aa..70c88e9b 100644 --- a/test/opt/ext4shl.c +++ b/test/opt/ext4shl.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s // // https://bugzilla.kernel.org/show_bug.cgi?id=14287 diff --git a/test/opt/gpgdiv.c b/test/opt/gpgdiv.c index 73ea813f..526f774e 100644 --- a/test/opt/gpgdiv.c +++ b/test/opt/gpgdiv.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s int bar(int); diff --git a/test/opt/memcpy.c b/test/opt/memcpy.c index 9666a519..1c30695c 100644 --- a/test/opt/memcpy.c +++ b/test/opt/memcpy.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s #include diff --git a/test/opt/pqdiv.c b/test/opt/pqdiv.c index 285ec44d..11877269 100644 --- a/test/opt/pqdiv.c +++ b/test/opt/pqdiv.c @@ -1,5 +1,5 @@ -// RUN: %cc -DNORETURN= %s | optck | diagdiff --prefix=exp %s -// RUN: %cc %s | optck | diagdiff %s +// RUN: %cc -DNORETURN= %s | %optck | %diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff %s // // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616180 diff --git a/test/opt/ptr-2008-1685.c b/test/opt/ptr-2008-1685.c index 30de22c3..37792586 100644 --- a/test/opt/ptr-2008-1685.c +++ b/test/opt/ptr-2008-1685.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s // // https://groups.google.com/d/msg/comp.os.plan9/NYdK1L7rf8Q/yfAiZoOlwNUJ diff --git a/test/opt/realloc-null.c b/test/opt/realloc-null.c index f3e34bee..b6d146a4 100644 --- a/test/opt/realloc-null.c +++ b/test/opt/realloc-null.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s #include #include diff --git a/test/opt/use-after-free.c b/test/opt/use-after-free.c index baeb64f8..f7672420 100644 --- a/test/opt/use-after-free.c +++ b/test/opt/use-after-free.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s #include diff --git a/test/opt/winner1.c b/test/opt/winner1.c index a2c968b4..1f703c58 100644 --- a/test/opt/winner1.c +++ b/test/opt/winner1.c @@ -1,4 +1,4 @@ -// TODO: %cc %s | optck | diagdiff --prefix=exp %s +// TODO: %cc %s | %optck | %diagdiff --prefix=exp %s // // http://blog.regehr.org/archives/767 diff --git a/test/opt/winner2.c b/test/opt/winner2.c index 9e8f3396..832bd170 100644 --- a/test/opt/winner2.c +++ b/test/opt/winner2.c @@ -1,4 +1,4 @@ -// RUN: %cc %s | optck | diagdiff --prefix=exp %s +// RUN: %cc %s | %optck | %diagdiff --prefix=exp %s // // http://blog.regehr.org/archives/767 diff --git a/test/stack-build b/test/stack-build.in similarity index 62% rename from test/stack-build rename to test/stack-build.in index f7d8c111..264d08a7 100755 --- a/test/stack-build +++ b/test/stack-build.in @@ -1,7 +1,6 @@ #!/usr/bin/env bash -DIR=$(dirname "${BASH_SOURCE[0]}") -ABS_DIR=$(cd "${DIR}/stack"; pwd) +ABS_DIR="$(cd '@pkglibexecdir@' && pwd)" export PATH="${ABS_DIR}:${PATH}" export CC="${ABS_DIR}/cc" export CXX="${ABS_DIR}/c++"