From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../shift_right_valarray_value.pass.cpp | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp (limited to 'test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp') diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp new file mode 100644 index 000000000000..0c0ba54463e1 --- /dev/null +++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template class valarray; + +// template valarray operator>>(const valarray& x, const T& y); + +#include +#include + +int main() +{ + { + typedef int T; + T a1[] = { 8, 16, 24, 32, 40}; + T a2[] = { 1, 2, 3, 4, 5}; + const unsigned N = sizeof(a1)/sizeof(a1[0]); + std::valarray v1(a1, N); + std::valarray v2 = v1 >> 3; + assert(v1.size() == v2.size()); + for (int i = 0; i < v2.size(); ++i) + assert(v2[i] == a2[i]); + } +} -- cgit v1.3