gcc/libstdc++-v3/testsuite/26_numerics/valarray/binary_closure.cc
Paolo Carlini 482c0c5d0f complex_inserters_extractors.cc, [...]: Move to...
2004-06-22  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/26_numerics/complex_inserters_extractors.cc,
	complex_value.cc, buggy_complex.cc: Move to...
	* testsuite/26_numerics/complex/: ... here.
	* testsuite/26_numerics/c99_classification_macros_c++.cc,
	c99_classification_macros_c.cc, c_math.cc, c_math_dynamic.cc,
	fabs_inline.cc: Move to...
	* testsuite/26_numerics/cmath/: ... here.
	* testsuite/26_numerics/binary_closure.cc, slice.cc,
	slice_array_assignment.cc, valarray.cc, valarray_const_bracket.cc,
	valarray_name_lookup.cc, valarray_operators.cc,
	valarray_subset_assignment.cc: Move to...
	* testsuite/26_numerics/valarray/: ... here (new dir).
	* testsuite/26_numerics/sum_diff.cc: Move to...
	* testsuite/26_numerics/numeric/: ... here (new dir).

From-SVN: r83489
2004-06-22 10:52:14 +00:00

38 lines
754 B
C++

// 19990805 gdr
//
// XXX: to impove later.
// Origin: Andreas Amann <amann@physik.tu-berlin.de>
// CXXFLAGS: -g
#include <iostream>
#include <valarray>
int main()
{
std::valarray<double> a(10), b(10), c(10), d(10);
a = 1.2;
b = 3.1;
c = 4.0;
d = ( 2.0 * b + a ); // works
std::cout << "d[4] = " << d[4] << std::endl;
d = (a * 2.0 + b ); // works
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + b * 2.0 ); // segfaults!
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
return 0;
}