From b76161e41bc2c07cd47f9c61f875d1be95e26d10 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 16 May 2017 19:47:58 +0000 Subject: Vendor import of lldb trunk r303197: https://llvm.org/svn/llvm-project/lldb/trunk@303197 --- .../cpp/class-template-parameter-pack/Makefile | 3 ++ .../TestClassTemplateParameterPack.py | 9 ++++ .../cpp/class-template-parameter-pack/main.cpp | 61 ++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile create mode 100644 packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py create mode 100644 packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp (limited to 'packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack') diff --git a/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile new file mode 100644 index 000000000000..99bfa7e03b47 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py new file mode 100644 index 000000000000..aad2ea20c133 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py @@ -0,0 +1,9 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( + __file__, globals(), [ + decorators.expectedFailureAll( + oslist=["windows"], bugnumber="llvm.org/pr24764"), + decorators.expectedFailureAll( + compiler="gcc")]) diff --git a/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp new file mode 100644 index 000000000000..90e63b40f417 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp @@ -0,0 +1,61 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LIDENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +template struct C { + T member; + bool isSixteenThirtyTwo() { return false; } +}; + +template <> struct C { + int member; + bool isSixteenThirtyTwo() { return false; } +}; + +template <> struct C : C { + bool isSixteenThirtyTwo() { return true; } +}; + +template struct D { + T member; + bool isIntBool() { return false; } +}; + +template <> struct D { + int member; + bool isIntBool() { return false; } +}; + +template <> struct D : D { + bool isIntBool() { return true; } +}; + +int main (int argc, char const *argv[]) +{ + C myC; + C myLesserC; + myC.member = 64; + (void)C().isSixteenThirtyTwo(); + (void)C().isSixteenThirtyTwo(); + (void)(myC.member != 64); //% self.expect("expression -- myC", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) + //% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) + //% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) + //% self.expect("expression -- myLesserC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) + //% self.expect("expression -- myC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) + + D myD; + D myLesserD; + myD.member = 64; + (void)D().isIntBool(); + (void)D().isIntBool(); + return myD.member != 64; //% self.expect("expression -- myD", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"]) + //% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) + //% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) + //% self.expect("expression -- myLesserD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"]) + //% self.expect("expression -- myD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"]) +} -- cgit v1.2.3