about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-18 22:26:42 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-18 22:26:42 -0700
commitb31aaa21d5aa0e25091ee51d5bfff561ec929561 (patch)
tree5b0518824fc5a83ac4d543cf61ba06fe19f924be
parentc8dd393cf175f9c56de9bf656dab3255095d8bbe (diff)
downloadmu-b31aaa21d5aa0e25091ee51d5bfff561ec929561.tar.gz
1404 - undefined-behavior checks using clang
While I'm at it I also explored turning on optimization. With
optimization compile+test of the chessboard app takes 10+3s, while
without optimization it takes 3+8s. So we're still better off without
optimizations in a tight debug loop. (Since we stopped tracing the big
chessboard test.)
-rw-r--r--makefile7
-rwxr-xr-xtest_all_layers5
2 files changed, 10 insertions, 2 deletions
diff --git a/makefile b/makefile
index e6f30d40..4f9f0f84 100644
--- a/makefile
+++ b/makefile
@@ -16,14 +16,17 @@ tangle/tangle:
 termbox/libtermbox.a:
 	cd termbox && make
 
-.PHONY: autogenerated_lists test valgrind clena
+.PHONY: autogenerated_lists test valgrind clang clena
 
 test: mu
 	./mu test
 
-valgrind: mu
+valgrind: clang
 	valgrind --leak-check=yes -q --error-exitcode=1 ./mu test
 
+clang: makefile mu.cc termbox/libtermbox.a autogenerated_lists
+	clang++ -fsanitize=undefined mu.cc termbox/libtermbox.a -o mu
+
 # auto-generated files; by convention they end in '_list'.
 autogenerated_lists: mu.cc function_list test_list
 
diff --git a/test_all_layers b/test_all_layers
index 4117dde0..e4c91640 100755
--- a/test_all_layers
+++ b/test_all_layers
@@ -5,3 +5,8 @@ do
   echo "=== $f"
   ./build_and_test_until $f || exit 0
 done
+
+echo "=== chessboard"
+rm mu.cc
+make clang
+mu test chessboard.mu  # our most intensive test so far