Skip to content

Commit 95fa676

Browse files
authored
[LLDB] Compile API tests with exceptions enabled on Windows (#148691)
From #148554 - compile tests with exceptions on Windows (`-fno-exceptions` was added 11 years ago in c782652). The variant test uses `try {} catch {}` to create variants that are valueless by exception. On other platforms, exceptions are enabled as well. I have no clue why compiling with exceptions will optimize out `a_long_guy` in the changed test (even with `-O0`). Taking the address of that value will ensure it's kept.
1 parent a9021e5 commit 95fa676

File tree

2 files changed

+1
-4
lines changed
  • lldb
    • packages/Python/lldbsuite/test/make
    • test/API/functionalities/data-formatter/data-formatter-advanced

2 files changed

+1
-4
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,6 @@ endif
344344
#----------------------------------------------------------------------
345345
ifeq "$(OS)" "Windows_NT"
346346
ifeq ($(CC_TYPE), clang)
347-
# Clang for Windows doesn't support C++ Exceptions
348-
CXXFLAGS += -fno-exceptions
349-
CXXFLAGS += -D_HAS_EXCEPTIONS=0
350-
351347
# MSVC 2015 or higher is required, which depends on c++14, so
352348
# append these values unconditionally.
353349
CXXFLAGS += -fms-compatibility-version=19.0

lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ int main (int argc, const char * argv[])
165165
Simple a_simple_object(3,0.14,'E');
166166

167167
VeryLong a_long_guy;
168+
auto *unused = &a_long_guy; // ensure a_long_guy isn't optimized out
168169

169170
std::string some_string = "012345678901234567890123456789"
170171
"012345678901234567890123456789"

0 commit comments

Comments
 (0)