Harden this test case to do the right thing in the face of compiler changes

llvm-svn: 251732
This commit is contained in:
Enrico Granata
2015-10-31 01:19:27 +00:00
parent 5796eb2d10
commit 2ef8822951
2 changed files with 8 additions and 2 deletions

View File

@@ -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")

View File

@@ -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);
}