[Lldb-commits] [lldb] 10df88d - [lldb] Remove some unnecessary includes from test sources
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 19 05:13:12 PST 2020
Author: Raphael Isemann
Date: 2020-02-19T14:12:45+01:00
New Revision: 10df88de21772ff40818bec7eef6b099ba4279fb
URL: https://github.com/llvm/llvm-project/commit/10df88de21772ff40818bec7eef6b099ba4279fb
DIFF: https://github.com/llvm/llvm-project/commit/10df88de21772ff40818bec7eef6b099ba4279fb.diff
LOG: [lldb] Remove some unnecessary includes from test sources
Added:
Modified:
lldb/test/API/commands/frame/var/main.c
lldb/test/API/commands/target/basic/a.c
lldb/test/API/lang/c/anonymous/main.c
lldb/test/API/lang/c/conflicting-symbol/One/One.c
lldb/test/API/lang/c/conflicting-symbol/Two/Two.c
lldb/test/API/lang/c/conflicting-symbol/main.c
lldb/test/API/lang/c/forward/foo.c
lldb/test/API/lang/c/forward/main.c
lldb/test/API/lang/c/global_variables/main.c
lldb/test/API/lang/c/step-target/main.c
lldb/test/API/lang/c/stepping/main.c
lldb/test/API/lang/c/strings/main.c
lldb/test/API/lang/cpp/auto/TestCPPAuto.py
lldb/test/API/lang/cpp/auto/main.cpp
lldb/test/API/lang/cpp/static_members/main.cpp
Removed:
################################################################################
diff --git a/lldb/test/API/commands/frame/var/main.c b/lldb/test/API/commands/frame/var/main.c
index da23af2ac550..531a20a94d93 100644
--- a/lldb/test/API/commands/frame/var/main.c
+++ b/lldb/test/API/commands/frame/var/main.c
@@ -1,11 +1,8 @@
-#include <stdio.h>
-
int g_var = 200;
int
main(int argc, char **argv)
{
int test_var = 10;
- printf ("Set a breakpoint here: %d %d.\n", test_var, g_var);
- return 0;
+ return test_var + g_var; // Set a breakpoint here
}
diff --git a/lldb/test/API/commands/target/basic/a.c b/lldb/test/API/commands/target/basic/a.c
index ec4824ad4ad7..b451d4ed703c 100644
--- a/lldb/test/API/commands/target/basic/a.c
+++ b/lldb/test/API/commands/target/basic/a.c
@@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
int main(int argc, const char* argv[])
{
diff --git a/lldb/test/API/lang/c/anonymous/main.c b/lldb/test/API/lang/c/anonymous/main.c
index 58ac85b7d431..990d79b23b5d 100644
--- a/lldb/test/API/lang/c/anonymous/main.c
+++ b/lldb/test/API/lang/c/anonymous/main.c
@@ -1,5 +1,3 @@
-#include <stdio.h>
-
struct anonymous_nest {
struct {
struct {
@@ -74,9 +72,9 @@ int main()
type_z *pz = 0;
type_z z = {{2}};
- printf("%d\n", processor_nest(&n));
- printf("%d\n", processor_child(&c));
- printf("%d\n", processor_grandchild(&g)); // Set breakpoint 2 here.
+ processor_nest(&n);
+ processor_child(&c);
+ processor_grandchild(&g); // Set breakpoint 2 here.
return 0;
}
diff --git a/lldb/test/API/lang/c/conflicting-symbol/One/One.c b/lldb/test/API/lang/c/conflicting-symbol/One/One.c
index 6bd729f65700..568d130e32d9 100644
--- a/lldb/test/API/lang/c/conflicting-symbol/One/One.c
+++ b/lldb/test/API/lang/c/conflicting-symbol/One/One.c
@@ -1,6 +1,5 @@
#include "One.h"
-#include <stdio.h>
void one() {
- printf("One\n"); // break here
+ int i = 0; // break here
}
diff --git a/lldb/test/API/lang/c/conflicting-symbol/Two/Two.c b/lldb/test/API/lang/c/conflicting-symbol/Two/Two.c
index 8d8d668b8c31..e0d75540861c 100644
--- a/lldb/test/API/lang/c/conflicting-symbol/Two/Two.c
+++ b/lldb/test/API/lang/c/conflicting-symbol/Two/Two.c
@@ -1,6 +1,5 @@
#include "Two.h"
-#include <stdio.h>
void two() {
- printf("Two\n"); // break here
+ int i = 0; // break here
}
diff --git a/lldb/test/API/lang/c/conflicting-symbol/main.c b/lldb/test/API/lang/c/conflicting-symbol/main.c
index 4dcd443c0492..0c22ae8494ff 100644
--- a/lldb/test/API/lang/c/conflicting-symbol/main.c
+++ b/lldb/test/API/lang/c/conflicting-symbol/main.c
@@ -1,11 +1,8 @@
#include "One/One.h"
#include "Two/Two.h"
-#include <stdio.h>
-
int main() {
one();
two();
- printf("main\n"); // break here
- return(0);
+ return 0; // break here
}
diff --git a/lldb/test/API/lang/c/forward/foo.c b/lldb/test/API/lang/c/forward/foo.c
index 2e050e77778d..4c66d1eba48b 100644
--- a/lldb/test/API/lang/c/forward/foo.c
+++ b/lldb/test/API/lang/c/forward/foo.c
@@ -1,8 +1,7 @@
-#include <stdio.h>
#include "foo.h"
int
foo (struct bar *bar_ptr)
{
- return printf ("bar_ptr = %p\n", bar_ptr);
+ return 1;
}
diff --git a/lldb/test/API/lang/c/forward/main.c b/lldb/test/API/lang/c/forward/main.c
index 6f9787c30a36..5a13f1d1ea2b 100644
--- a/lldb/test/API/lang/c/forward/main.c
+++ b/lldb/test/API/lang/c/forward/main.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
#include "foo.h"
struct bar
diff --git a/lldb/test/API/lang/c/global_variables/main.c b/lldb/test/API/lang/c/global_variables/main.c
index ea54eb927c0c..caa715db3d57 100644
--- a/lldb/test/API/lang/c/global_variables/main.c
+++ b/lldb/test/API/lang/c/global_variables/main.c
@@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
int g_common_1; // Not initialized on purpose to cause it to be undefined external in .o file
int g_file_global_int = 42;
@@ -20,5 +19,5 @@ int main (int argc, char const *argv[])
g_common_1 = g_file_global_int / g_file_static_int;
static const char *g_func_static_cstr = "g_func_static_cstr";
printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
- return g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point at this line. //// break $source:$line; continue; var -global g_a -global g_global_int
+ return *g_file_global_cstr + *g_file_static_cstr + g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point at this line. //// break $source:$line; continue; var -global g_a -global g_global_int
}
diff --git a/lldb/test/API/lang/c/step-target/main.c b/lldb/test/API/lang/c/step-target/main.c
index 86a26c4d47a4..5e4a490aa90b 100644
--- a/lldb/test/API/lang/c/step-target/main.c
+++ b/lldb/test/API/lang/c/step-target/main.c
@@ -1,5 +1,3 @@
-#include <stdio.h>
-
void
lotsOfArgs
(
@@ -9,11 +7,7 @@ lotsOfArgs
int fourthArg
)
{
- printf ("First: %d Second: %d Third: %d Fourth: %d.\n",
- firstArg,
- secondArg,
- thirdArg,
- fourthArg);
+ int x = firstArg + secondArg + thirdArg + fourthArg;
}
int
@@ -28,13 +22,12 @@ main (int argc, char **argv)
if (argc > 0)
{
int var_makes_block = argc + 1;
- printf ("Break here to try targetted stepping.\n");
+ int dummy = 0; // Break here to try targetted stepping.
lotsOfArgs(var_makes_block,
modifyInt(20),
30,
modifyInt(40));
- printf ("Done calling lotsOfArgs.");
+ int abc = 0; // Done calling lotsOfArgs.
}
- printf ("All done.\n");
- return 0;
+ return 0; // All done.
}
diff --git a/lldb/test/API/lang/c/stepping/main.c b/lldb/test/API/lang/c/stepping/main.c
index fce61bfd93ea..6dcb33350b05 100644
--- a/lldb/test/API/lang/c/stepping/main.c
+++ b/lldb/test/API/lang/c/stepping/main.c
@@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
int a(int);
int b(int);
@@ -47,14 +46,11 @@ int complex (int first, int second, int third)
int main (int argc, char const *argv[])
{
int A1 = a(1); // frame select 2, thread step-out while stopped at "c(1)"
- printf("a(1) returns %d\n", A1);
-
+
int B2 = b(2);
- printf("b(2) returns %d\n", B2);
-
+
int A3 = a(3); // frame select 1, thread step-out while stopped at "c(3)"
- printf("a(3) returns %d\n", A3);
-
+
int A4 = complex (a(1), b(2), c(3)); // Stop here to try step in targeting b.
int A5 = complex (a(2), b(3), c(4)); // Stop here to try step in targeting complex.
@@ -63,6 +59,5 @@ int main (int argc, char const *argv[])
int A7 = complex (a(5), b(6), c(7)); // Stop here to make sure bogus target steps over.
- printf ("I am using print_string: %s.\n", print_string);
- return 0;
+ return A1 + B2 + A3 + A4 + A5 + A6 + A7 + *print_string;
}
diff --git a/lldb/test/API/lang/c/strings/main.c b/lldb/test/API/lang/c/strings/main.c
index 3e7ead084786..4115520c95f4 100644
--- a/lldb/test/API/lang/c/strings/main.c
+++ b/lldb/test/API/lang/c/strings/main.c
@@ -6,12 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
-
int main()
{
const char a[] = "abcde";
const char *z = "vwxyz";
-
- printf("%s %s", a, z); // breakpoint 1
+
+ return *a + *z; // breakpoint 1
}
diff --git a/lldb/test/API/lang/cpp/auto/TestCPPAuto.py b/lldb/test/API/lang/cpp/auto/TestCPPAuto.py
index 139b974bd32b..c8a33e6cf658 100644
--- a/lldb/test/API/lang/cpp/auto/TestCPPAuto.py
+++ b/lldb/test/API/lang/cpp/auto/TestCPPAuto.py
@@ -34,8 +34,4 @@ def test_with_run_command(self):
'Test',
'123',
'456'])
- self.expect(
- 'expr auto s = helloworld; s',
- substrs=[
- 'string',
- 'hello world'])
+ self.expect_expr("auto s = foo; s", result_type="long", result_value="1234")
diff --git a/lldb/test/API/lang/cpp/auto/main.cpp b/lldb/test/API/lang/cpp/auto/main.cpp
index d411af679119..21dc61b928cd 100644
--- a/lldb/test/API/lang/cpp/auto/main.cpp
+++ b/lldb/test/API/lang/cpp/auto/main.cpp
@@ -6,15 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <string>
-
int main()
{
- std::string helloworld("hello world");
-
- // Ensure std::string copy constructor is present in the binary, as we will
- // use it in an expression.
- std::string other = helloworld;
+ long foo = 1234;
return 0; // break here
}
diff --git a/lldb/test/API/lang/cpp/static_members/main.cpp b/lldb/test/API/lang/cpp/static_members/main.cpp
index ab8ae1b645f1..6fa6774e0314 100644
--- a/lldb/test/API/lang/cpp/static_members/main.cpp
+++ b/lldb/test/API/lang/cpp/static_members/main.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
-
struct A
{
short m_a;
More information about the lldb-commits
mailing list