summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
commit061da546b983eb767bad15e67af1174fb0bcf31c (patch)
tree83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack
parentImport LLVM 10.0.0 release including clang, lld and lldb. (diff)
downloadwireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.tar.xz
wireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.zip
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom tested by plenty
Diffstat (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack')
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py12
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp23
2 files changed, 35 insertions, 0 deletions
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 <class T> int staticSizeof() {
+ return sizeof(T);
+}
+
+template <class T1, class T2, class... Ts> int staticSizeof() {
+ return staticSizeof<T2, Ts...>() + sizeof(T1);
+}
+
+int main (int argc, char const *argv[])
+{
+ int sz = staticSizeof<long, int, char>();
+ return staticSizeof<long, int, char>() != sz; //% self.expect("expression -- sz == staticSizeof<long, int, char>()", "staticSizeof<long, int, char> worked", substrs = ["true"])
+ //% self.expect("expression -- sz == staticSizeof<long, int>() + sizeof(char)", "staticSizeof<long, int> worked", substrs = ["true"])
+ //% self.expect("expression -- sz == staticSizeof<long>() + sizeof(int) + sizeof(char)", "staticSizeof<long> worked", substrs = ["true"])
+}