Skip to content

Commit f5941b8

Browse files
author
Siva Chandra
committedApr 15, 2015
[TestMiBreak] Print a formatted string via printf in the test case.
Summary: If the string is not formatted, these can happen when compiled with GCC: 1. If it is a null string "", then GCC completely removes the call to printf even with -O0. 2. If the string is a single character string, say "\n" for example, then GCC replaces the call to printf with a call to putchar. 3. If the string length is greater than 1, but is not formatted, then GCC replaces the call to printf with a call to puts. All the above will fail the test as we want a breakpoint on "printf" to hit. Test Plan: dotest.py -C gcc -p TestMiBreak Reviewers: chying, ki.stfu Reviewed By: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9025 llvm-svn: 235034
1 parent 09129d9 commit f5941b8

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed
 

‎lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):
1313
@lldbmi_test
1414
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
1515
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
16-
@expectedFailureGcc #xfail to get buildbot green, test failed with gcc4.8.2
1716
def test_lldbmi_break_insert_function_pending(self):
1817
"""Test that 'lldb-mi --interpreter' works for pending function breakpoints."""
1918

@@ -38,7 +37,6 @@ def test_lldbmi_break_insert_function_pending(self):
3837
@lldbmi_test
3938
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
4039
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
41-
@expectedFailureGcc #xfail to get buildbot green, test failed with gcc4.8.2
4240
def test_lldbmi_break_insert_function(self):
4341
"""Test that 'lldb-mi --interpreter' works for function breakpoints."""
4442

@@ -98,7 +96,6 @@ def test_lldbmi_break_insert_file_line_pending(self):
9896
@lldbmi_test
9997
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
10098
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
101-
@expectedFailureGcc #xfail to get buildbot green, test failed with gcc4.8.2
10299
def test_lldbmi_break_insert_file_line(self):
103100
"""Test that 'lldb-mi --interpreter' works for file:line breakpoints."""
104101

‎lldb/test/tools/lldb-mi/breakpoint/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
int
1313
main(int argc, char const *argv[])
1414
{
15-
printf("");
15+
printf("Print a formatted string so that GCC does not optimize this printf call: %s\n", argv[0]);
1616
return 0; // BP_return
1717
}

0 commit comments

Comments
 (0)
Please sign in to comment.