From f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:50:09 +0000 Subject: Vendor import of lldb release_39 branch r276489: https://llvm.org/svn/llvm-project/lldb/branches/release_39@276489 --- .../functionalities/data-formatter/parray/main.cpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp (limited to 'packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp') diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp new file mode 100644 index 000000000000..b2d6309947ad --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp @@ -0,0 +1,29 @@ +//===-- main.cpp -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include +#include + +template +ElemType* alloc(size_t count, std::function get) +{ + ElemType *elems = new ElemType[count]; + for(size_t i = 0; i < count; i++) + elems[i] = get(i); + return elems; +} + +int main (int argc, const char * argv[]) +{ + int* data = alloc(5, [] (size_t idx) -> int { + return 2 * idx + 1; + }); + return 0; // break here +} + -- cgit v1.2.3