summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbinline.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbinline.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbinline.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 6a61b2eaf55..8d619cf829d 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -2,7 +2,9 @@ from __future__ import print_function
from __future__ import absolute_import
# System modules
+import filecmp
import os
+import sys
# Third-party modules
@@ -89,9 +91,6 @@ class InlineTest(TestBase):
return "-N dsym %s" % (self.mydir)
def BuildMakefile(self):
- if os.path.exists("Makefile"):
- return
-
categories = {}
for f in os.listdir(os.getcwd()):
@@ -102,7 +101,7 @@ class InlineTest(TestBase):
else:
categories[t] = [f]
- makefile = open("Makefile", 'w+')
+ makefile = open("Makefile.tmp", 'w+')
level = os.sep.join([".."] * len(self.mydir.split(os.sep))) + os.sep + "make"
@@ -118,11 +117,26 @@ class InlineTest(TestBase):
if ('CXX_SOURCES' in list(categories.keys())):
makefile.write("CXXFLAGS += -std=c++11\n")
- makefile.write("include $(LEVEL)/Makefile.rules\n")
+ # clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+ # targets. Other targets do not, which causes this test to fail.
+ # This flag enables FullDebugInfo for all targets.
+
+ makefile.write("ifneq (,$(findstring clang,$(CC)))\n")
+ makefile.write(" CFLAGS_EXTRAS += -fno-limit-debug-info\n")
+ makefile.write("endif\n\n")
+
+ makefile.write("include $(LEVEL)/Makefile.rules\n\n")
+
makefile.write("\ncleanup:\n\trm -f Makefile *.d\n\n")
makefile.flush()
makefile.close()
+ if os.path.exists("Makefile"):
+ if not filecmp.cmp("Makefile", "Makefile.tmp"):
+ sys.exit("Existing Makefile doesn't match generated Makefile!")
+
+ os.rename("Makefile.tmp", "Makefile")
+
@skipUnlessDarwin
def __test_with_dsym(self):
self.using_dsym = True
OpenPOWER on IntegriCloud