diff options
author | Shafik Yaghmour <syaghmour@apple.com> | 2018-09-17 23:15:35 +0000 |
---|---|---|
committer | Shafik Yaghmour <syaghmour@apple.com> | 2018-09-17 23:15:35 +0000 |
commit | 2ee93d28fd39adb9bcf80cb4de3edbfe3f746f69 (patch) | |
tree | f274c41580dabf315b1a22ba75ebbbd4208ba2b2 /lldb/packages/Python/lldbsuite/test | |
parent | 1e1f3c8298d2992b0157f60fcd5c44a5ec13b446 (diff) | |
download | bcm5719-llvm-2ee93d28fd39adb9bcf80cb4de3edbfe3f746f69.tar.gz bcm5719-llvm-2ee93d28fd39adb9bcf80cb4de3edbfe3f746f69.zip |
Revert "[DataFormatters] Add formatter for C++17 std::variant"
This reverts commit r342421.
Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console
llvm-svn: 342424
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 0 insertions, 148 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/Makefile deleted file mode 100644 index a6ea665ef63..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -LEVEL = ../../../../../make - -CXX_SOURCES := main.cpp - -USE_LIBCPP := 1 -include $(LEVEL)/Makefile.rules -CXXFLAGS += -std=c++17 diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py deleted file mode 100644 index 9ea7ac33166..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py +++ /dev/null @@ -1,81 +0,0 @@ -""" -Test lldb data formatter subsystem. -""" - -from __future__ import print_function - - -import os -import time -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - -class LibcxxOptionalDataFormatterTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - @add_test_categories(["libc++"]) - ## We are skipping clang version less that 5.0 since this test requires -std=c++17 - @skipIf(oslist=no_match(["macosx"]), compiler="clang", compiler_version=['<', '5.0']) - ## We are skipping gcc version less that 5.1 since this test requires -std=c++17 - @skipIf(compiler="gcc", compiler_version=['<', '5.1']) - - def test_with_run_command(self): - """Test that that file and class static variables display correctly.""" - self.build() - - (self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here', - lldb.SBFileSpec("main.cpp", False)) - - self.runCmd( "frame variable has_variant" ) - - output = self.res.GetOutput() - - ## The variable has_variant tells us if the test program - ## detected we have a sufficient libc++ version to support variant - ## false means we do not and therefore should skip the test - if output.find("(bool) has_variant = false") != -1 : - self.skipTest( "std::variant not supported" ) - - lldbutil.continue_to_breakpoint(self.process, bkpt) - - self.expect("frame variable v1", - substrs=['v1 = Active Type = int {', - 'Value = 12', - '}']) - - self.expect("frame variable v1_ref", - substrs=['v1_ref = Active Type = int : {', - 'Value = 12', - '}']) - - self.expect("frame variable v_v1", - substrs=['v_v1 = Active Type = std::__1::variant<int, double, char> {', - 'Value = Active Type = int {', - 'Value = 12', - '}', - '}']) - - lldbutil.continue_to_breakpoint(self.process, bkpt) - - self.expect("frame variable v1", - substrs=['v1 = Active Type = double {', - 'Value = 2', - '}']) - - lldbutil.continue_to_breakpoint(self.process, bkpt) - - self.expect("frame variable v2", - substrs=['v2 = Active Type = double {', - 'Value = 2', - '}']) - - self.expect("frame variable v3", - substrs=['v3 = Active Type = char {', - 'Value = \'A\'', - '}']) - - self.expect("frame variable v_no_value", - substrs=['v_no_value = No Value']) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp deleted file mode 100644 index c0bc4ae12c1..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include <cstdio> -#include <string> -#include <vector> - -// If we have libc++ 4.0 or greater we should have <variant> -// According to libc++ C++1z status page https://libcxx.llvm.org/cxx1z_status.html -#if _LIBCPP_VERSION >= 4000 -#include <variant> -#define HAVE_VARIANT 1 -#else -#define HAVE_VARIANT 0 -#endif - -struct S { - operator int() { throw 42; } -} ; - - -int main() -{ - bool has_variant = HAVE_VARIANT ; - - printf( "%d\n", has_variant ) ; // break here - -#if HAVE_VARIANT == 1 - std::variant<int, double, char> v1; - std::variant<int, double, char> &v1_ref = v1; - std::variant<int, double, char> v2; - std::variant<int, double, char> v3; - std::variant<std::variant<int,double,char>> v_v1 ; - std::variant<int, double, char> v_no_value; - - v1 = 12; // v contains int - v_v1 = v1 ; - int i = std::get<int>(v1); - printf( "%d\n", i ); // break here - - v2 = 2.0 ; - double d = std::get<double>(v2) ; - printf( "%f\n", d ); - - v3 = 'A' ; - char c = std::get<char>(v3) ; - printf( "%d\n", c ); - - // Checking v1 above and here to make sure we done maintain the incorrect - // state when we change its value. - v1 = 2.0; - d = std::get<double>(v1) ; - printf( "%f\n", d ); // break here - - try { - v_no_value.emplace<0>(S()); - } catch( ... ) {} - - printf( "%zu\n", v_no_value.index() ) ; -#endif - - return 0; // break here -} |