From 061da546b983eb767bad15e67af1174fb0bcf31c Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 3 Aug 2020 14:33:06 +0000 Subject: Import LLVM 10.0.0 release including clang, lld and lldb. ok hackroom tested by plenty --- .../TestFunctionTemplateParameterPack.py | 12 +++++++++++ .../cpp/function-template-parameter-pack/main.cpp | 23 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py create mode 100644 gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack') diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py new file mode 100644 index 00000000000..b90f74656cd --- /dev/null +++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py @@ -0,0 +1,12 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +# https://bugs.llvm.org/show_bug.cgi?id=35920 +# This test stresses expression evaluation support for template functions. +# Currently the support is rudimentary, and running this test causes assertion +# failures in clang. This test cannot be XFAIL'ed because the test harness +# treats assertion failures as unexpected events. For now, the test must be +# skipped. +lldbinline.MakeInlineTest( + __file__, globals(), [ + decorators.skipIf]) diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp new file mode 100644 index 00000000000..eea2830aef8 --- /dev/null +++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp @@ -0,0 +1,23 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +template int staticSizeof() { + return sizeof(T); +} + +template int staticSizeof() { + return staticSizeof() + sizeof(T1); +} + +int main (int argc, char const *argv[]) +{ + int sz = staticSizeof(); + return staticSizeof() != sz; //% self.expect("expression -- sz == staticSizeof()", "staticSizeof worked", substrs = ["true"]) + //% self.expect("expression -- sz == staticSizeof() + sizeof(char)", "staticSizeof worked", substrs = ["true"]) + //% self.expect("expression -- sz == staticSizeof() + sizeof(int) + sizeof(char)", "staticSizeof worked", substrs = ["true"]) +} -- cgit v1.2.3-59-g8ed1b