[Lldb-commits] [lldb] r245552 - Skip TestCreateDuringInstructionStep on android aarch64

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 20 04:37:19 PDT 2015


Author: labath
Date: Thu Aug 20 06:37:19 2015
New Revision: 245552

URL: http://llvm.org/viewvc/llvm-project?rev=245552&view=rev
Log:
Skip TestCreateDuringInstructionStep on android aarch64

we are unable to step through _M_start_thread due to atomic instruction sequences.

Modified:
    lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py?rev=245552&r1=245551&r2=245552&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py (original)
+++ lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py Thu Aug 20 06:37:19 2015
@@ -25,6 +25,8 @@ class CreateDuringInstructionStepTestCas
         self.create_during_step_inst_test()
 
     @dwarf_test
+    @skipIfTargetAndroid(archs=['aarch64'])
+    @expectedFailureAndroid("llvm.org/pr23944", archs=['aarch64']) # We are unable to step through std::thread::_M_start_thread
     def test_step_inst_with_dwarf(self):
         self.buildDwarf(dictionary=self.getBuildFlags())
         self.create_during_step_inst_test()
@@ -62,7 +64,8 @@ class CreateDuringInstructionStepTestCas
             # instruction, which creates the thread.
             if thread.GetFrameAtIndex(0).GetFunctionName() in [
                     '__sync_fetch_and_add_4', # Android arm: unable to set a breakpoint for software single-step
-                    'pthread_mutex_lock'      # Android arm: function contains atomic instruction sequences
+                    'pthread_mutex_lock',     # Android arm: function contains atomic instruction sequences
+                    'pthread_mutex_unlock'    # Android arm: function contains atomic instruction sequences
                     ]:
                 thread.StepOut()
             else:

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=245552&r1=245551&r2=245552&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu Aug 20 06:37:19 2015
@@ -698,6 +698,18 @@ def expectedFailureWindows(bugnumber=Non
 def expectedFailureHostWindows(bugnumber=None, compilers=None):
     return expectedFailureHostOS(['windows'], bugnumber, compilers)
 
+def matchAndroid(api_levels=None, archs=None):
+    def match(self):
+        if not target_is_android():
+            return False
+        if archs is not None and self.getArchitecture() not in archs:
+            return False
+        if api_levels is not None and android_device_api() not in api_levels:
+            return False
+        return True
+    return match
+
+
 def expectedFailureAndroid(bugnumber=None, api_levels=None, archs=None):
     """ Mark a test as xfail for Android.
 
@@ -708,15 +720,7 @@ def expectedFailureAndroid(bugnumber=Non
         arch - A sequence of architecture names specifying the architectures
             for which a test is expected to fail. None means all architectures.
     """
-    def fn(self):
-        if target_is_android():
-            if archs is not None and self.getArchitecture() not in archs:
-                return False
-            if api_levels is not None and android_device_api() not in api_levels:
-                return False
-            return True
-
-    return expectedFailure(fn, bugnumber)
+    return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
 # if the test passes on the first try, we're done (success)
 # if the test fails once, then passes on the second try, raise an ExpectedFailure
@@ -1061,12 +1065,14 @@ def skipIfi386(func):
             func(*args, **kwargs)
     return wrapper
 
-def skipIfTargetAndroid(api_levels=None):
+def skipIfTargetAndroid(api_levels=None, archs=None):
     """Decorator to skip tests when the target is Android.
 
     Arguments:
         api_levels - The API levels for which the test should be skipped. If
             it is None, then the test will be skipped for all API levels.
+        arch - A sequence of architecture names specifying the architectures
+            for which a test is skipped. None means all architectures.
     """
     def myImpl(func):
         if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -1076,14 +1082,9 @@ def skipIfTargetAndroid(api_levels=None)
         def wrapper(*args, **kwargs):
             from unittest2 import case
             self = args[0]
-            if target_is_android():
-                if api_levels:
-                    device_api = android_device_api()
-                    if device_api and (device_api in api_levels):
-                        self.skipTest(
-                            "skip on Android target with API %d" % device_api)
-                else:
-                    self.skipTest("skip on Android target")
+            if matchAndroid(api_levels, archs)(self):
+                self.skipTest("skiped on Android target with API %d and architecture %s" %
+                        (android_device_api(), self.getArchitecture()))
             func(*args, **kwargs)
         return wrapper
     return myImpl




More information about the lldb-commits mailing list