Skip to content

Commit a38b5b1

Browse files
authored
Merge pull request #612 from fredriss/cherry-pick-testsuite-improvements
Cherry pick testsuite improvements
2 parents 52a408f + 8cce5eb commit a38b5b1

File tree

3 files changed

+27
-49
lines changed

3 files changed

+27
-49
lines changed
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
CXX_SOURCES = main.cpp length.cpp a.cpp
2-
3-
CFLAGS_LIMIT = -c $(CXXFLAGS)
4-
CFLAGS_NO_LIMIT = -c $(CXXFLAGS)
5-
6-
ifneq (,$(findstring clang,$(CC)))
7-
CFLAGS_LIMIT += -flimit-debug-info
8-
CFLAGS_NO_LIMIT += -fno-limit-debug-info
9-
endif
1+
CXX_SOURCES := length.cpp a.o main.o
2+
EXE := nolimit
103

114
all: limit nolimit
125

13-
limit: main.o length_limit.o a.o
14-
$(CXX) main.o length_limit.o a.o -o limit $(LDFLAGS)
15-
16-
nolimit: main.o length_nolimit.o a.o
17-
$(CXX) main.o length_nolimit.o a.o -o nolimit $(LDFLAGS)
18-
19-
main.o: main.cpp
20-
$(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/main.cpp -o main.o
21-
22-
length_limit.o: length.cpp
23-
$(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/length.cpp -o length_limit.o
6+
include Makefile.rules
247

25-
length_nolimit.o: length.cpp
26-
$(CXX) $(CFLAGS_NO_LIMIT) $(SRCDIR)/length.cpp -o length_nolimit.o
8+
# Force a.cpp to be built with no debug inforamtion
9+
a.o: CFLAGS = $(CFLAGS_NO_DEBUG)
2710

28-
a.o: a.cpp
29-
$(CXX) $(CFLAGS_NO_DEBUG) -c $(SRCDIR)/a.cpp -o a.o
11+
# The default testsuite setup forces -fno-limit-debug-info. Let's not rely on
12+
# CFLAGS_EXTRAS being passed after the default arguments. This rule makes
13+
# sure the variable used by Makefile.rules for this argument is cleared.
14+
main.o: NO_LIMIT_DEBUG_INFO_FLAGS = ""
15+
main.o: CFLAGS_EXTRAS = -flimit-debug-info
3016

31-
clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o length_limit.dwo length_nolimit.dwo
17+
limit: a.o main.o
18+
mkdir -p build_limit
19+
$(MAKE) -C $(BUILDDIR)/build_limit -f $(MAKEFILE_RULES) \
20+
EXE=../limit CXX_SOURCES="length.cpp ../a.o ../main.o" \
21+
CFLAGS_EXTRAS=-flimit-debug-info NO_LIMIT_DEBUG_INFO_FLAGS=""
3222

33-
include Makefile.rules
Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
1-
CC ?= clang
2-
ifeq "$(ARCH)" ""
3-
ARCH = x86_64
4-
endif
1+
OBJC_SOURCES := myclass.m repro.m
2+
LD_EXTRAS := -framework Foundation
53

6-
ifeq "$(OS)" ""
7-
OS = $(shell uname -s)
8-
endif
9-
10-
CFLAGS ?= -g -O0
11-
CFLAGS_NO_DEBUG =
12-
ifeq "$(OS)" "Darwin"
13-
CFLAGS += -arch $(ARCH)
14-
CFLAGS_NO_DEBUG += -arch $(ARCH)
15-
endif
16-
17-
all: aout
18-
19-
aout:
20-
$(CC) $(CFLAGS_NO_DEBUG) $(SRCDIR)/myclass.m -c -o myclass.o
21-
$(CC) $(CFLAGS) myclass.o $(SRCDIR)/repro.m -framework Foundation
4+
include Makefile.rules
225

23-
clean::
24-
rm -f myclass.o
6+
# Force myclass.m to be compiled without debug info
7+
myclass.o: CFLAGS = $(CFLAGS_NO_DEBUG)
258

26-
include Makefile.rules

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ BUILDDIR := $(shell pwd)
3434
THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
3535
LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
3636

37+
# The test harness invokes the test Makefiles with an explicit 'all'
38+
# target, but its handy to be able to recursively call this Makefile
39+
# without speficying a goal. You almost certainly want to build 'all',
40+
# and not only the first target defined in this file (which might vary
41+
# according to varaible values).
42+
.DEFAULT_GOAL := all
43+
3744
#----------------------------------------------------------------------
3845
# If OS is not defined, use 'uname -s' to determine the OS name.
3946
#

0 commit comments

Comments
 (0)