Commit e9e17a6a authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

continuing with fortran test (disabled test for const correctness -

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
intermediately)


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2468
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent a04aed78
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.28 2007-12-07 08:15:29 tforb Exp $
# $Id: Makefile,v 1.29 2007-12-08 17:04:47 tforb Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
......@@ -337,6 +337,9 @@ showsections: $(README)
tests/%.P:
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
tests/f2ctest: tests/f77test.cc install-include libaff.a
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
tests/%: tests/%.cc install-include libaff.a
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
......
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.14 2007-12-07 16:50:56 tforb Exp $
# $Id: Makefile,v 1.15 2007-12-08 17:04:47 tforb Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
......@@ -59,11 +59,14 @@ $(addsuffix .run,$(EXECUTABLES)): %.run: %; $< $(ARG); rm -fv $< $<.o
FC=g77
F2C=f2c
%.o: %.f f77common.inc
%.f2c.o: %.f f77common.inc
$(F2C) -C++ -f -u $<
$(CXX) -c -o $@ $(<:.f=.c) $(CXXFLAGS) $(CPPFLAGS) $(FLAGS)
/bin/rm -fv $(<:.f=.c)
%.o: %.f f77common.inc
$(FC) -o $@ -c $< $(FCFLAGS) $(FLAGS)
%.code: %.f f77common.inc
$(F2C) -C++ -f -u $<
-/bin/mv -v $(patsubst %.f,%.c,$<) $(patsubst %.f,%.code,$<)
......@@ -80,7 +83,10 @@ f77common_com.P: f77procs.f f77common.inc
f77interface.o: f77interface.cc f77proto.h f77procs.P f77common_com.P
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS) $(FLAGS)
f77test: f77test.o f77procs.o f77interface.o
f2ctest: f77test.o f77procs.f2c.o f77interface.o
$(CXX) -o $@ $^ $(LDFLAGS) -laff -lf2c -lm
f77test: f77test.o f77procs.o f77interface.o
$(CXX) -o $@ $^ $(LDFLAGS) -laff -lg2c -lm
# ----- END OF Makefile -----
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: f77test.cc,v 1.12 2006-03-28 16:03:11 tforb Exp $
* $Id: f77test.cc,v 1.13 2007-12-08 17:04:47 tforb Exp $
* \author Thomas Forbriger
* \date 22/12/2002
*
......@@ -65,7 +65,7 @@
#define AFF_F77TEST_CC_VERSION \
"AFF_F77TEST_CC V1.2"
#define AFF_F77TEST_CC_CVSID \
"$Id: f77test.cc,v 1.12 2006-03-28 16:03:11 tforb Exp $"
"$Id: f77test.cc,v 1.13 2007-12-08 17:04:47 tforb Exp $"
#include <aff/array.h>
#include <aff/fortranshape.h>
......@@ -181,9 +181,11 @@ int main()
CODE(typedef std::complex<int> Ticvalue);
CODE(typedef std::complex<float> Tcvalue);
CODE(Array<Ticvalue> v1(1));
CODE(ConstArray<Ticvalue> v2(v1));
// CODE(ConstArray<Ticvalue> v2(v1));
CODE(Array<Ticvalue> v2(v1));
CODE(FortranArray<Array<Ticvalue> > fv1(v1));
CODE(FortranArray<ConstArray<Ticvalue> > fv2(v2));
// CODE(FortranArray<ConstArray<Ticvalue> > fv2(v2));
CODE(FortranArray<Array<Ticvalue> > fv2(v2));
CODE(v1(1)=Ticvalue(3,7));
CODE(cout << v1(1) << ", " << v2(1) << endl);
CODE(Ticvalue *icp=fv1.castedpointer<Ticvalue>());
......@@ -203,9 +205,11 @@ int main()
section("Test illegal usage (only if activated through macro-definition):",
' ');
CODE(Array<int> iv1(1));
CODE(ConstArray<int> iv2(iv1));
// CODE(ConstArray<int> iv2(iv1));
CODE(Array<int> iv2(iv1));
CODE(FortranArray<Array<int> > fiv1(iv1));
CODE(FortranArray<ConstArray<int> > fiv2(iv2));
// CODE(FortranArray<ConstArray<int> > fiv2(iv2));
CODE(FortranArray<Array<int> > fiv2(iv2));
CODE(iv1(1)=50);
CODE(cout << iv1(1) << ", " << iv2(1) << endl);
CODE(int *iv1p=fiv1.pointer());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment