[Lldb-commits] [lldb] r251732 - Harden this test case to do the right thing in the face of compiler changes

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 30 18:19:28 PDT 2015


Author: enrico
Date: Fri Oct 30 20:19:27 2015
New Revision: 251732

URL: http://llvm.org/viewvc/llvm-project?rev=251732&view=rev
Log:
Harden this test case to do the right thing in the face of compiler changes

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py?rev=251732&r1=251731&r2=251732&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py Fri Oct 30 20:19:27 2015
@@ -25,6 +25,7 @@ class ConstVariableTestCase(TestBase):
     @expectedFailureAll(oslist=["freebsd", "linux"], compiler="icc")
     @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
     @expectedFailureWindows("llvm.org/pr24490: We shouldn't be using platform-specific names like `getpid` in tests")
+    @expectedFailureDarwin
     def test_and_run_command(self):
         """Test interpreted and JITted expressions on constant values."""
         self.build()
@@ -46,6 +47,7 @@ class ConstVariableTestCase(TestBase):
             substrs = [' resolved, hit count = 1'])
 
         self.runCmd("next")
+        self.runCmd("next")
 
         # Try frame variable.
         self.expect("frame variable index", VARIABLES_DISPLAYED_CORRECTLY,
@@ -53,10 +55,10 @@ class ConstVariableTestCase(TestBase):
 
         # Try an interpreted expression.
         self.expect("expr (index + 512)", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ['(int) $0 = 1024'])
+            substrs = ['1024'])
 
         # Try a JITted expression.
         self.expect("expr (int)getpid(); (index - 256)", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ['(int) $1 = 256'])
+            substrs = ['256'])
 
         self.runCmd("kill")

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c?rev=251732&r1=251731&r2=251732&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c Fri Oct 30 20:19:27 2015
@@ -1,4 +1,5 @@
 #include <stdint.h>
+#include <stdio.h>
 
 extern int foo();
 extern int bar();
@@ -13,7 +14,10 @@ int main()
   index = 512;
 
   if (bar())
+  {
+    printf("COMPILER PLEASE STOP HERE\n");
     index = 256;
+  }
 
   baaz(index);
 }




More information about the lldb-commits mailing list