summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/ArrayRefTest.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-02-17 15:37:53 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-02-17 15:37:53 +0000
commitf4984a961feaa18c8c184c924aca5865be6c0839 (patch)
tree2f853a4213fd3c593fdcc2b06fe6b430a0dd0206 /llvm/unittests/ADT/ArrayRefTest.cpp
parent944511621e77e59c315ea5edb05718c5ad754b6a (diff)
downloadbcm5719-llvm-f4984a961feaa18c8c184c924aca5865be6c0839.tar.gz
bcm5719-llvm-f4984a961feaa18c8c184c924aca5865be6c0839.zip
I believe we no longer require LLVM_HAS_INITIALIZER_LISTS; it's supported in MSVC 2013 and GCC. Added a trivial test to ensure the ArrayRef initializer list constructor is called and behaves as expected.
If any of the bots complain (perhaps due to an antiquated version of an STL implementation), I will revert. llvm-svn: 229502
Diffstat (limited to 'llvm/unittests/ADT/ArrayRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/ArrayRefTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/ArrayRefTest.cpp b/llvm/unittests/ADT/ArrayRefTest.cpp
index f9c98a563fa..c6854aed4b6 100644
--- a/llvm/unittests/ADT/ArrayRefTest.cpp
+++ b/llvm/unittests/ADT/ArrayRefTest.cpp
@@ -90,4 +90,10 @@ TEST(ArrayRefTest, ConstConvert) {
a = ArrayRef<int *>(A);
}
+TEST(ArrayRefTest, InitializerList) {
+ ArrayRef<int> A{ 0, 1, 2, 3, 4 };
+ for (int i = 0; i < 5; ++i)
+ EXPECT_EQ(i, A[i]);
+}
+
} // end anonymous namespace
OpenPOWER on IntegriCloud