Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <valarray>
|
||||
|
||||
// template<class T> class valarray;
|
||||
|
||||
// template <class T>
|
||||
// unspecified1
|
||||
// begin(const valarray<T>& v);
|
||||
|
||||
#include <valarray>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef int T;
|
||||
T a[] = {1, 2, 3, 4, 5};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
const std::valarray<T> v(a, N);
|
||||
assert(v[0] == 1);
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <valarray>
|
||||
|
||||
// template<class T> class valarray;
|
||||
|
||||
// template <class T>
|
||||
// unspecified1
|
||||
// begin(valarray<T>& v);
|
||||
|
||||
#include <valarray>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef int T;
|
||||
T a[] = {1, 2, 3, 4, 5};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
std::valarray<T> v(a, N);
|
||||
*begin(v) = 10;
|
||||
assert(v[0] == 10);
|
||||
}
|
||||
}
|
31
test/std/numerics/numarray/valarray.range/end_const.pass.cpp
Normal file
31
test/std/numerics/numarray/valarray.range/end_const.pass.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <valarray>
|
||||
|
||||
// template<class T> class valarray;
|
||||
|
||||
// template <class T>
|
||||
// unspecified1
|
||||
// end(const valarray<T>& v);
|
||||
|
||||
#include <valarray>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef int T;
|
||||
T a[] = {1, 2, 3, 4, 5};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
const std::valarray<T> v(a, N);
|
||||
assert(v[v.size()-1] == 5);
|
||||
assert(end(v) - begin(v) == v.size());
|
||||
}
|
||||
}
|
@@ -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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <valarray>
|
||||
|
||||
// template<class T> class valarray;
|
||||
|
||||
// template <class T>
|
||||
// unspecified1
|
||||
// end(valarray<T>& v);
|
||||
|
||||
#include <valarray>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef int T;
|
||||
T a[] = {1, 2, 3, 4, 5};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
std::valarray<T> v(a, N);
|
||||
*(end(v) - 1) = 10;
|
||||
assert(v[v.size()-1] == 10);
|
||||
assert(end(v) - begin(v) == v.size());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user