Skip to content

Cherry pick testsuite improvements #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
CXX_SOURCES = main.cpp length.cpp a.cpp

CFLAGS_LIMIT = -c $(CXXFLAGS)
CFLAGS_NO_LIMIT = -c $(CXXFLAGS)

ifneq (,$(findstring clang,$(CC)))
CFLAGS_LIMIT += -flimit-debug-info
CFLAGS_NO_LIMIT += -fno-limit-debug-info
endif
CXX_SOURCES := length.cpp a.o main.o
EXE := nolimit

all: limit nolimit

limit: main.o length_limit.o a.o
$(CXX) main.o length_limit.o a.o -o limit $(LDFLAGS)

nolimit: main.o length_nolimit.o a.o
$(CXX) main.o length_nolimit.o a.o -o nolimit $(LDFLAGS)

main.o: main.cpp
$(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/main.cpp -o main.o

length_limit.o: length.cpp
$(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/length.cpp -o length_limit.o
include Makefile.rules

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

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

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

include Makefile.rules
28 changes: 5 additions & 23 deletions lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
CC ?= clang
ifeq "$(ARCH)" ""
ARCH = x86_64
endif
OBJC_SOURCES := myclass.m repro.m
LD_EXTRAS := -framework Foundation

ifeq "$(OS)" ""
OS = $(shell uname -s)
endif

CFLAGS ?= -g -O0
CFLAGS_NO_DEBUG =
ifeq "$(OS)" "Darwin"
CFLAGS += -arch $(ARCH)
CFLAGS_NO_DEBUG += -arch $(ARCH)
endif

all: aout

aout:
$(CC) $(CFLAGS_NO_DEBUG) $(SRCDIR)/myclass.m -c -o myclass.o
$(CC) $(CFLAGS) myclass.o $(SRCDIR)/repro.m -framework Foundation
include Makefile.rules

clean::
rm -f myclass.o
# Force myclass.m to be compiled without debug info
myclass.o: CFLAGS = $(CFLAGS_NO_DEBUG)

include Makefile.rules
7 changes: 7 additions & 0 deletions lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ BUILDDIR := $(shell pwd)
THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../

# The test harness invokes the test Makefiles with an explicit 'all'
# target, but its handy to be able to recursively call this Makefile
# without speficying a goal. You almost certainly want to build 'all',
# and not only the first target defined in this file (which might vary
# according to varaible values).
.DEFAULT_GOAL := all

#----------------------------------------------------------------------
# If OS is not defined, use 'uname -s' to determine the OS name.
#
Expand Down