Skip to content

Commit

Permalink
Make sure to build clangsa before running clangsa self tests (#37385)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored Sep 3, 2020
1 parent 9548c2d commit f51d4cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ ifneq ($(BUILD_LLVM_CLANG),1)
endif
endif

clangsa: $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT)

clang-sa-%: $(SRCDIR)/%.c $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) | analyzegc-deps-check
@$(call PRINT_ANALYZE, $(build_depsbindir)/clang --analyze -Xanalyzer -analyzer-werror -Xanalyzer -analyzer-output=text -Xclang -load -Xclang $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) $(CLANGSA_FLAGS) $(JCPPFLAGS) $(JCFLAGS) $(DEBUGFLAGS) -Xclang -analyzer-checker=core$(COMMA)julia.GCChecker --analyzer-no-default-checks -fcolor-diagnostics -Werror -x c $<)
clang-sa-%: $(SRCDIR)/%.cpp $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) | analyzegc-deps-check
Expand Down
2 changes: 2 additions & 0 deletions test/clangsa/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
JULIAHOME := $(abspath $(SRCDIR)/../..)
BUILDDIR := .
include $(JULIAHOME)/Make.inc

check: $(SRCDIR)

TESTS = $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/*.c) $(wildcard $(SRCDIR)/*.cpp))

$(SRCDIR) $(TESTS):
@$(MAKE) -C $(BUILDDIR)/../../src clangsa
PATH=$(build_bindir):$(build_depsbindir):$$PATH \
LD_LIBRARY_PATH="${build_libdir}:$$LD_LIBRARY_PATH" \
CLANGSA_FLAGS="${CLANGSA_FLAGS}" \
Expand Down

0 comments on commit f51d4cb

Please sign in to comment.