summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/expression_command/call-restarts/TestCallThatRestarts.py2
-rw-r--r--lldb/test/expression_command/expr-in-syscall/Makefile2
-rw-r--r--lldb/test/expression_command/expr-in-syscall/main.cpp (renamed from lldb/test/expression_command/expr-in-syscall/main.c)5
-rw-r--r--lldb/test/functionalities/load_unload/TestLoadUnload.py6
-rw-r--r--lldb/test/functionalities/process_attach/Makefile2
-rw-r--r--lldb/test/functionalities/process_attach/main.cpp (renamed from lldb/test/functionalities/process_attach/main.c)6
-rw-r--r--lldb/test/functionalities/register/main.cpp6
-rw-r--r--lldb/test/functionalities/signal/TestSendSignal.py3
-rw-r--r--lldb/test/functionalities/thread/exit_during_break/main.cpp4
-rw-r--r--lldb/test/functionalities/thread/exit_during_step/main.cpp2
-rw-r--r--lldb/test/functionalities/thread/state/Makefile2
-rw-r--r--lldb/test/functionalities/thread/state/TestThreadStates.py34
-rw-r--r--lldb/test/functionalities/thread/state/main.cpp (renamed from lldb/test/functionalities/thread/state/main.c)5
-rw-r--r--lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py1
-rw-r--r--lldb/test/lang/c/tls_globals/TestTlsGlobals.py1
15 files changed, 46 insertions, 35 deletions
diff --git a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py
index fddd9a5c916..e6636091b57 100644
--- a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -1,4 +1,4 @@
-"""
+"""
Test calling a function that hits a signal set to auto-restart, make sure the call completes.
"""
diff --git a/lldb/test/expression_command/expr-in-syscall/Makefile b/lldb/test/expression_command/expr-in-syscall/Makefile
index 0d70f259501..8a7102e347a 100644
--- a/lldb/test/expression_command/expr-in-syscall/Makefile
+++ b/lldb/test/expression_command/expr-in-syscall/Makefile
@@ -1,5 +1,5 @@
LEVEL = ../../make
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
diff --git a/lldb/test/expression_command/expr-in-syscall/main.c b/lldb/test/expression_command/expr-in-syscall/main.cpp
index d101825b7b2..743b69434d5 100644
--- a/lldb/test/expression_command/expr-in-syscall/main.c
+++ b/lldb/test/expression_command/expr-in-syscall/main.cpp
@@ -1,11 +1,12 @@
-#include <unistd.h>
+#include <chrono>
+#include <thread>
volatile int release_flag = 0;
int main(int argc, char const *argv[])
{
while (! release_flag) // Wait for debugger to attach
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
return 0;
}
diff --git a/lldb/test/functionalities/load_unload/TestLoadUnload.py b/lldb/test/functionalities/load_unload/TestLoadUnload.py
index 3c05d68a324..2bb2333952a 100644
--- a/lldb/test/functionalities/load_unload/TestLoadUnload.py
+++ b/lldb/test/functionalities/load_unload/TestLoadUnload.py
@@ -1,4 +1,4 @@
-"""
+"""
Test that breakpoint by symbol name works correctly with dynamic libs.
"""
@@ -69,6 +69,7 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@not_remote_testsuite_ready
+ @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_modules_search_paths(self):
"""Test target modules list after loading a different copy of the library libd.dylib, and verifies that it works with 'target modules search-paths add'."""
@@ -122,6 +123,7 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@skipUnlessListedRemote(['android'])
@expectedFailureAndroid # wrong source file shows up for hidden library
+ @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_dyld_library_path(self):
"""Test (DY)LD_LIBRARY_PATH after moving libd.dylib, which defines d_function, somewhere else."""
@@ -177,6 +179,7 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@skipUnlessListedRemote(['android'])
@expectedFailureAndroid # dlopen and dlclose prefixed with "__dl_" on android causing JIT compilation issues
+ @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_lldb_process_load_and_unload_commands(self):
"""Test that lldb process load/unload command work correctly."""
@@ -279,6 +282,7 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@skipUnlessListedRemote(['android'])
+ @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_step_over_load (self):
"""Test stepping over code that loads a shared library works correctly."""
diff --git a/lldb/test/functionalities/process_attach/Makefile b/lldb/test/functionalities/process_attach/Makefile
index 0ec14b915c3..a964853f534 100644
--- a/lldb/test/functionalities/process_attach/Makefile
+++ b/lldb/test/functionalities/process_attach/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../make
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
EXE := ProcessAttach
diff --git a/lldb/test/functionalities/process_attach/main.c b/lldb/test/functionalities/process_attach/main.cpp
index af4fdba023a..8021feac5c7 100644
--- a/lldb/test/functionalities/process_attach/main.c
+++ b/lldb/test/functionalities/process_attach/main.cpp
@@ -1,10 +1,12 @@
#include <stdio.h>
-#include <unistd.h>
#if defined(__linux__)
#include <sys/prctl.h>
#endif
+#include <chrono>
+#include <thread>
+
int main(int argc, char const *argv[]) {
int temp;
#if defined(__linux__)
@@ -27,7 +29,7 @@ int main(int argc, char const *argv[]) {
while (temp < 30) // Waiting to be attached...
{
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(2));
temp++;
}
diff --git a/lldb/test/functionalities/register/main.cpp b/lldb/test/functionalities/register/main.cpp
index 7e74322abff..d0e5dc159b6 100644
--- a/lldb/test/functionalities/register/main.cpp
+++ b/lldb/test/functionalities/register/main.cpp
@@ -7,12 +7,14 @@
//
//===----------------------------------------------------------------------===//
#include <stdio.h>
-#include <unistd.h>
#if defined(__linux__)
#include <sys/prctl.h>
#endif
+#include <chrono>
+#include <thread>
+
int main (int argc, char const *argv[])
{
#if defined(__linux__)
@@ -36,7 +38,7 @@ int main (int argc, char const *argv[])
{
volatile int wait_for_attach=1;
while (wait_for_attach)
- usleep(1);
+ std::this_thread::sleep_for(std::chrono::microseconds(1));
}
printf("my_string=%s\n", my_string);
diff --git a/lldb/test/functionalities/signal/TestSendSignal.py b/lldb/test/functionalities/signal/TestSendSignal.py
index 9a7b6b5bcad..4b01b57413a 100644
--- a/lldb/test/functionalities/signal/TestSendSignal.py
+++ b/lldb/test/functionalities/signal/TestSendSignal.py
@@ -1,4 +1,4 @@
-"""Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works."""
+"""Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works."""
import os, time, signal
import unittest2
@@ -19,6 +19,7 @@ class SendSignalTestCase(TestBase):
self.send_signal()
@expectedFailureFreeBSD("llvm.org/pr23318: does not report running state")
+ @skipIfWindows # Windows does not support signals
@dwarf_test
def test_with_dwarf_and_run_command(self):
"""Test that lldb command 'process signal SIGUSR1' sends a signal to the inferior process."""
diff --git a/lldb/test/functionalities/thread/exit_during_break/main.cpp b/lldb/test/functionalities/thread/exit_during_break/main.cpp
index b8e1cc6a222..3570637207d 100644
--- a/lldb/test/functionalities/thread/exit_during_break/main.cpp
+++ b/lldb/test/functionalities/thread/exit_during_break/main.cpp
@@ -13,8 +13,8 @@
// breakpoint is hit. The test case should be flexible enough to treat that
// as success.
-#include <unistd.h>
#include <atomic>
+#include <chrono>
#include <thread>
volatile int g_test = 0;
@@ -83,7 +83,7 @@ exit_thread_func ()
pseudo_barrier_wait(g_barrier2);
// Try to make sure this thread doesn't exit until the breakpoint is hit.
- usleep(1);
+ std::this_thread::sleep_for(std::chrono::microseconds(1));
// Return
return NULL;
diff --git a/lldb/test/functionalities/thread/exit_during_step/main.cpp b/lldb/test/functionalities/thread/exit_during_step/main.cpp
index 3280fdbf872..d1b364b8baa 100644
--- a/lldb/test/functionalities/thread/exit_during_step/main.cpp
+++ b/lldb/test/functionalities/thread/exit_during_step/main.cpp
@@ -10,8 +10,6 @@
// This test is intended to create a situation in which one thread will exit
// while the debugger is stepping in another thread.
-#include <unistd.h>
-
#include <thread>
// Note that although hogging the CPU while waiting for a variable to change
diff --git a/lldb/test/functionalities/thread/state/Makefile b/lldb/test/functionalities/thread/state/Makefile
index 3b5a8a30fa4..26db4816b6e 100644
--- a/lldb/test/functionalities/thread/state/Makefile
+++ b/lldb/test/functionalities/thread/state/Makefile
@@ -1,4 +1,4 @@
LEVEL = ../../../make
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
diff --git a/lldb/test/functionalities/thread/state/TestThreadStates.py b/lldb/test/functionalities/thread/state/TestThreadStates.py
index abc06b7115f..d7c7da76276 100644
--- a/lldb/test/functionalities/thread/state/TestThreadStates.py
+++ b/lldb/test/functionalities/thread/state/TestThreadStates.py
@@ -1,4 +1,4 @@
-"""
+"""
Test thread states.
"""
@@ -95,8 +95,8 @@ class ThreadStateTestCase(TestBase):
# Call super's setUp().
TestBase.setUp(self)
# Find the line numbers for our breakpoints.
- self.break_1 = line_number('main.c', '// Set first breakpoint here')
- self.break_2 = line_number('main.c', '// Set second breakpoint here')
+ self.break_1 = line_number('main.cpp', '// Set first breakpoint here')
+ self.break_2 = line_number('main.cpp', '// Set second breakpoint here')
def thread_state_after_breakpoint_test(self):
"""Test thread state after breakpoint."""
@@ -104,11 +104,11 @@ class ThreadStateTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1)
# The breakpoint list should show 1 breakpoint with 1 location.
self.expect("breakpoint list -f", "Breakpoint location shown correctly",
- substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1])
+ substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.break_1])
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
@@ -144,12 +144,12 @@ class ThreadStateTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1)
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1)
# The breakpoint list should show 1 breakpoints with 1 location.
self.expect("breakpoint list -f", "Breakpoint location shown correctly",
- substrs = ["1: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.break_1])
+ substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.break_1])
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
@@ -193,12 +193,12 @@ class ThreadStateTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1)
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1)
# The breakpoint list should show 1 breakpoints with 1 location.
self.expect("breakpoint list -f", "Breakpoint location shown correctly",
- substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1])
+ substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.break_1])
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
@@ -238,11 +238,11 @@ class ThreadStateTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1)
# The breakpoint list should show 1 breakpoints with 1 location.
self.expect("breakpoint list -f", "Breakpoint location shown correctly",
- substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1])
+ substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.break_1])
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
@@ -291,13 +291,13 @@ class ThreadStateTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1)
- lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1)
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1)
# The breakpoint list should show 2 breakpoints with 1 location each.
self.expect("breakpoint list -f", "Breakpoint location shown correctly",
- substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1,
- "2: file = 'main.c', line = %d, locations = 1" % self.break_2])
+ substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.break_1,
+ "2: file = 'main.cpp', line = %d, locations = 1" % self.break_2])
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/lldb/test/functionalities/thread/state/main.c b/lldb/test/functionalities/thread/state/main.cpp
index ebcaa138c6e..081203da8da 100644
--- a/lldb/test/functionalities/thread/state/main.c
+++ b/lldb/test/functionalities/thread/state/main.cpp
@@ -12,7 +12,8 @@
// is in the test script. This program merely provides places where the test
// can create the intended states.
-#include <unistd.h>
+#include <chrono>
+#include <thread>
volatile int g_test = 0;
@@ -28,7 +29,7 @@ int doNothing()
while (!g_test && temp < 5)
{
++temp;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(2));
}
return temp; // Set second breakpoint here
diff --git a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
index 5d362051bf2..88501c3abd2 100644
--- a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
+++ b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
@@ -21,6 +21,7 @@ class NoreturnUnwind(TestBase):
@dwarf_test
@expectedFailurei386 #xfail to get buildbot green, failing config: i386 binary running on ubuntu 14.04 x86_64
+ @skipIfWindows # clang-cl does not support gcc style attributes.
def test_with_dwarf (self):
"""Test that we can backtrace correctly with 'noreturn' functions on the stack"""
self.buildDwarf()
diff --git a/lldb/test/lang/c/tls_globals/TestTlsGlobals.py b/lldb/test/lang/c/tls_globals/TestTlsGlobals.py
index f0165e77c62..fd90900ca1f 100644
--- a/lldb/test/lang/c/tls_globals/TestTlsGlobals.py
+++ b/lldb/test/lang/c/tls_globals/TestTlsGlobals.py
@@ -20,6 +20,7 @@ class TlsGlobalTestCase(TestBase):
@dwarf_test
@unittest2.expectedFailure("rdar://7796742")
+ @skipIfWindows # TLS works differently on Windows, this would need to be implemented separately.
def test_with_dwarf(self):
"""Test thread-local storage."""
self.buildDwarf()
OpenPOWER on IntegriCloud