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/main.cpp | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) 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/main.cpp') 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 0000000000000..90e63b40f4178 --- /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