Index: test/cctest/test-utils.cc |
diff --git a/test/cctest/test-utils.cc b/test/cctest/test-utils.cc |
index c1dae6484a2d6e0a81217c2f8045d7b0cbf9d7ea..cf34f69be1f3e9ceb6bcc0fc5aeb6224fbf24b9e 100644 |
--- a/test/cctest/test-utils.cc |
+++ b/test/cctest/test-utils.cc |
@@ -27,6 +27,8 @@ |
#include <stdlib.h> |
+#include <vector> |
+ |
#include "src/v8.h" |
#include "src/base/platform/platform.h" |
@@ -218,3 +220,40 @@ TEST(SequenceCollectorRegression) { |
CHECK_EQ(0, strncmp("0123456789012345678901234567890123", |
seq.start(), seq.length())); |
} |
+ |
+ |
+// TODO(svenpanne) Unconditionally test this when our infrastructure is fixed. |
+#if !V8_CC_MSVC |
+TEST(CPlusPlus11Features) { |
+ struct S { |
+ bool x; |
+ struct T { |
+ double y; |
+ int z[3]; |
+ } t; |
+ }; |
+ S s{true, {3.1415, {1, 2, 3}}}; |
+ CHECK_EQ(2, s.t.z[1]); |
+ |
+// TODO(svenpanne) Remove the old-skool code when we ship the new C++ headers. |
+#if 0 |
+ std::vector<int> vec{11, 22, 33, 44}; |
+#else |
+ std::vector<int> vec; |
+ vec.push_back(11); |
+ vec.push_back(22); |
+ vec.push_back(33); |
+ vec.push_back(44); |
+#endif |
+ vec.push_back(55); |
+ vec.push_back(66); |
+ for (auto& i : vec) { |
+ ++i; |
+ } |
+ int j = 12; |
+ for (auto i : vec) { |
+ CHECK_EQ(j, i); |
+ j += 11; |
+ } |
+} |
+#endif |