Commit d661b54b authored by nagayama15's avatar nagayama15

透かし埋め込みテストの追加

parent 3120244c
...@@ -19,8 +19,9 @@ LDFLAGS := \ ...@@ -19,8 +19,9 @@ LDFLAGS := \
all: nykk.so example all: nykk.so example
test: test: nykk.so
${MAKE} -C test run ${MAKE} -C test run
${MAKE} -C example test
example: nykk.so example: nykk.so
${MAKE} -C example ${MAKE} -C example
......
*.txt
fizzbuzz*
...@@ -5,10 +5,19 @@ LLS := ${SRCS:.c=.ll} ...@@ -5,10 +5,19 @@ LLS := ${SRCS:.c=.ll}
LLS_0 := ${SRCS:%.c=%-0.ll} LLS_0 := ${SRCS:%.c=%-0.ll}
LLS_1 := ${SRCS:%.c=%-1.ll} LLS_1 := ${SRCS:%.c=%-1.ll}
LLS_2 := ${SRCS:%.c=%-2.ll} LLS_2 := ${SRCS:%.c=%-2.ll}
BINS := ${LLS:.ll=} ${LLS_0:.ll=} ${LLS_1:.ll=} ${LLS_2:.ll=}
.PHONY: all clean .PHONY: all test clean
all: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2} all: ${BINS}
test: ${BINS}
./fizzbuzz > fizzbuzz.txt
./fizzbuzz-0 > fizzbuzz-0.txt
./fizzbuzz-1 > fizzbuzz-1.txt
./fizzbuzz-2 > fizzbuzz-2.txt
${BINS}: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
%.ll: %.c %.ll: %.c
clang -emit-llvm -S -O2 -o $@ $< clang -emit-llvm -S -O2 -o $@ $<
...@@ -20,5 +29,8 @@ all: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2} ...@@ -20,5 +29,8 @@ all: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
%-2.ll: %.ll %-2.ll: %.ll
opt-6.0 -load ../nykk.so -block-wm -watermark=2 -S -o $@ $< opt-6.0 -load ../nykk.so -block-wm -watermark=2 -S -o $@ $<
%: %.ll
clang -o $@ $<
clean: clean:
${RM} *.ll ${RM} ${BINS} *.ll *.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment