1# ################################################################
2# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc.
3# All rights reserved.
4#
5# This source code is licensed under both the BSD-style license (found in the
6# LICENSE file in the root directory of this source tree) and the GPLv2 (found
7# in the COPYING file in the root directory of this source tree).
8# You may select, at your option, one of the above-listed licenses.
9# ################################################################
10# datagen : Synthetic and parametrable data generator, for tests
11# fullbench  : Precisely measure speed for each zstd inner functions
12# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
13# fuzzer  : Test tool, to check zstd integrity on target platform
14# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
15# paramgrill : parameter tester for zstd
16# test-zstd-speed.py : script for testing zstd speed difference between commits
17# versionsTest : compatibility test between zstd versions stored on Github (v0.1+)
18# zstreamtest : Fuzzer test tool for zstd streaming API
19# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
20# ##########################################################################
21
22ZSTDDIR = ../lib
23PRGDIR  = ../programs
24PYTHON ?= python3
25TESTARTEFACT := versionsTest
26
27DEBUGLEVEL ?= 1
28export DEBUGLEVEL  # transmit value to sub-makefiles
29DEBUGFLAGS  = -g -DDEBUGLEVEL=$(DEBUGLEVEL)
30CPPFLAGS   += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
31              -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
32ifeq ($(OS),Windows_NT)   # MinGW assumed
33CPPFLAGS   += -D__USE_MINGW_ANSI_STDIO   # compatibility with %zu formatting
34endif
35CFLAGS     ?= -O3
36CFLAGS     += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow                 \
37              -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
38              -Wstrict-prototypes -Wundef                                     \
39              -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings      \
40              -Wredundant-decls -Wmissing-prototypes
41CFLAGS     += $(DEBUGFLAGS) $(MOREFLAGS)
42FLAGS       = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
43
44
45ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
46ZSTDCOMP_FILES   := $(ZSTDDIR)/compress/*.c
47ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
48ZSTD_FILES  := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
49ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c
50ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c
51
52ZSTD_F1 := $(wildcard $(ZSTD_FILES))
53ZSTD_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdm_,$(ZSTD_F1))
54ZSTD_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdc_,$(ZSTD_OBJ1))
55ZSTD_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdd_,$(ZSTD_OBJ2))
56ZSTD_OBJECTS := $(ZSTD_OBJ3:.c=.o)
57
58ZSTDMT_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdmt_m_,$(ZSTD_F1))
59ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1))
60ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
61ZSTDMT_OBJECTS := $(ZSTDMT_OBJ3:.c=.o)
62
63# Define *.exe as extension for Windows systems
64ifneq (,$(filter Windows%,$(OS)))
65EXT =.exe
66MULTITHREAD_CPP = -DZSTD_MULTITHREAD
67MULTITHREAD_LD  =
68else
69EXT =
70MULTITHREAD_CPP = -DZSTD_MULTITHREAD
71MULTITHREAD_LD  = -pthread
72endif
73MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
74
75VOID = /dev/null
76ZSTREAM_TESTTIME ?= -T90s
77FUZZERTEST ?= -T200s
78ZSTDRTTEST = --test-large-data
79DECODECORPUS_TESTTIME ?= -T30
80
81.PHONY: default
82default: fullbench
83
84.PHONY: all
85all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus roundTripCrash poolTests
86
87.PHONY: all32
88all32: fullbench32 fuzzer32 zstreamtest32
89
90.PHONY: allnothread
91allnothread: MULTITHREAD_CPP=
92allnothread: MULTITHREAD_LD=
93allnothread: fullbench fuzzer paramgrill datagen decodecorpus
94
95# note : broken : requires symbols unavailable from dynamic library
96.PHONY: dll
97dll: fuzzer-dll zstreamtest-dll
98
99.PHONY: zstd zstd32 zstd-nolegacy  # only external makefile knows how to build or update them
100zstd zstd32 zstd-nolegacy:
101	$(MAKE) -C $(PRGDIR) $@ MOREFLAGS+="$(DEBUGFLAGS)"
102
103.PHONY: libzstd
104libzstd :
105	$(MAKE) -C $(ZSTDDIR) libzstd MOREFLAGS+="$(DEBUGFLAGS)"
106
107%-dll : libzstd
108%-dll : LDFLAGS += -L$(ZSTDDIR) -lzstd
109
110.PHONY: $(ZSTDDIR)/libzstd.a
111$(ZSTDDIR)/libzstd.a :
112	$(MAKE) -C $(ZSTDDIR) libzstd.a
113
114zstdm_%.o : $(ZSTDDIR)/common/%.c
115	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
116
117zstdc_%.o : $(ZSTDDIR)/compress/%.c
118	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
119
120zstdd_%.o : $(ZSTDDIR)/decompress/%.c
121	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
122
123zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP)
124
125zstdmt_m_%.o : $(ZSTDDIR)/common/%.c
126	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
127
128zstdmt_c_%.o : $(ZSTDDIR)/compress/%.c
129	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
130
131zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.c
132	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
133
134fullbench32: CPPFLAGS += -m32
135fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP)
136fullbench fullbench32 : LDFLAGS += $(MULTITHREAD_LD)
137fullbench fullbench32 : DEBUGFLAGS = -DNDEBUG  # turn off assert() for speed measurements
138fullbench fullbench32 : $(ZSTD_FILES)
139fullbench fullbench32 : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
140	$(LINK.c) $^ -o $@$(EXT)
141
142fullbench-lib : CPPFLAGS += -DXXH_NAMESPACE=ZSTD_
143fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(ZSTDDIR)/libzstd.a fullbench.c
144	$(LINK.c) $^ -o $@$(EXT)
145
146# note : broken : requires symbols unavailable from dynamic library
147fullbench-dll: $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/benchfn.c $(PRGDIR)/timefn.c fullbench.c
148#	$(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll
149	$(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT)
150
151fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
152fuzzer : LDFLAGS += $(MULTITHREAD_LD)
153fuzzer : $(ZSTDMT_OBJECTS)
154fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
155
156fuzzer32 : CFLAGS += -m32 $(MULTITHREAD)
157fuzzer32 : $(ZSTD_FILES)
158	$(LINK.c) $^ -o $@$(EXT)
159
160# note : broken : requires symbols unavailable from dynamic library
161fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
162	$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
163
164zbufftest zbufftest32 zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated
165zbufftest zbufftest32 zbufftest-dll : CFLAGS += -Wno-deprecated-declarations   # required to silence deprecation warnings
166zbufftest32 : CFLAGS +=  -m32
167zbufftest zbufftest32 : $(ZSTD_OBJECTS) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
168	$(CC) $(FLAGS) $^ -o $@$(EXT)
169
170zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
171	$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
172
173ZSTREAM_LOCAL_FILES := $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c seqgen.c zstreamtest.c
174ZSTREAM_PROPER_FILES := $(ZDICT_FILES) $(ZSTREAM_LOCAL_FILES)
175ZSTREAMFILES := $(ZSTD_FILES) $(ZSTREAM_PROPER_FILES)
176zstreamtest32 : CFLAGS += -m32
177zstreamtest zstreamtest32 : CPPFLAGS += $(MULTITHREAD_CPP)
178zstreamtest zstreamtest32 : LDFLAGS += $(MULTITHREAD_LD)
179zstreamtest : $(ZSTDMT_OBJECTS) $(ZSTREAM_PROPER_FILES)
180zstreamtest32 : $(ZSTREAMFILES)
181zstreamtest zstreamtest32 :
182	$(LINK.c) $^ -o $@$(EXT)
183
184zstreamtest_asan : CFLAGS += -fsanitize=address
185zstreamtest_asan : $(ZSTREAMFILES)
186	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
187
188zstreamtest_tsan : CFLAGS += -fsanitize=thread
189zstreamtest_tsan : $(ZSTREAMFILES)
190	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
191
192# note : broken : requires symbols unavailable from dynamic library
193zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c  # xxh symbols not exposed from dll
194zstreamtest-dll : $(ZSTREAM_LOCAL_FILES)
195	$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
196
197paramgrill : DEBUGFLAGS =   # turn off debug for speed measurements
198paramgrill : LDLIBS += -lm
199paramgrill : $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(PRGDIR)/benchzstd.c $(PRGDIR)/datagen.c paramgrill.c
200
201datagen : $(PRGDIR)/datagen.c datagencli.c
202	$(LINK.c) $^ -o $@$(EXT)
203
204roundTripCrash: CFLAGS += $(MULTITHREAD)
205roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c
206
207longmatch : $(ZSTD_OBJECTS) longmatch.c
208
209bigdict: CFLAGS += $(MULTITHREAD)
210bigdict: $(ZSTDMT_OBJECTS) $(PRGDIR)/datagen.c bigdict.c
211
212invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c
213
214legacy : CPPFLAGS += -I$(ZSTDDIR)/legacy -DZSTD_LEGACY_SUPPORT=4
215legacy : $(ZSTD_FILES) $(wildcard $(ZSTDDIR)/legacy/*.c) legacy.c
216
217decodecorpus : LDLIBS += -lm
218decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c
219
220poolTests : $(PRGDIR)/util.c $(PRGDIR)/timefn.c poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c
221	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
222
223.PHONY: versionsTest
224versionsTest: clean
225	$(PYTHON) test-zstd-versions.py
226
227.PHONY: automated_benchmarking
228automated_benchmarking: clean
229	$(PYTHON) automated_benchmarking.py
230
231# make checkTag
232checkTag.o : $(ZSTDDIR)/zstd.h
233
234.PHONY: clean
235clean:
236	$(MAKE) -C $(ZSTDDIR) clean
237	$(MAKE) -C $(PRGDIR) clean
238	$(RM) -fR $(TESTARTEFACT)
239	$(RM) -rf tmp*  # some test directories are named tmp*
240	$(RM) core *.o *.tmp result* *.gcda dictionary *.zst \
241        $(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \
242        fullbench$(EXT) fullbench32$(EXT) \
243        fullbench-lib$(EXT) fullbench-dll$(EXT) \
244        fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \
245        fuzzer-dll$(EXT) zstreamtest-dll$(EXT) zbufftest-dll$(EXT) \
246        zstreamtest$(EXT) zstreamtest32$(EXT) \
247        datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \
248        symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \
249        decodecorpus$(EXT) checkTag$(EXT) bigdict$(EXT)
250	@echo Cleaning completed
251
252
253#----------------------------------------------------------------------------------
254# valgrind tests are validated only for some posix platforms
255#----------------------------------------------------------------------------------
256UNAME := $(shell uname)
257ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
258HOST_OS = POSIX
259
260valgrindTest: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
261valgrindTest: zstd datagen fuzzer fullbench
262	@echo "\n ---- valgrind tests : memory analyzer ----"
263	$(VALGRIND) ./datagen -g50M > $(VOID)
264	$(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi
265	./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID)
266	./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
267	./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp
268	$(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID)
269	./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
270	@rm tmp
271	$(VALGRIND) ./fuzzer -T1mn -t1
272	$(VALGRIND) ./fullbench -i1
273
274endif
275
276
277ifneq (,$(filter MINGW% MSYS%,$(UNAME)))
278  HOST_OS = MSYS
279endif
280
281
282#-----------------------------------------------------------------------------
283# make tests validated only for below targets
284#-----------------------------------------------------------------------------
285ifneq (,$(filter $(HOST_OS),MSYS POSIX))
286
287DIFF:=diff
288ifneq (,$(filter $(UNAME),SunOS))
289  DIFF:=gdiff
290endif
291
292.PHONY: list
293list:
294	@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
295
296.PHONY: shortest
297shortest: ZSTDRTTEST=  # remove long tests
298shortest: test-zstd
299
300.PHONY: check
301check: shortest
302
303.PHONY: fuzztest
304fuzztest: test-fuzzer test-zstream test-decodecorpus
305
306.PHONY: test
307test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus
308ifeq ($(QEMU_SYS),)
309test: test-pool
310endif
311
312.PHONY: test32
313test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32
314
315.PHONY: test-all
316test-all: test test32 valgrindTest test-decodecorpus-cli
317
318.PHONY: test-zstd test-zstd32 test-zstd-nolegacy test-zstdgrep
319test-zstd: ZSTD = $(PRGDIR)/zstd
320test-zstd: zstd
321
322test-zstd32: ZSTD = $(PRGDIR)/zstd32
323test-zstd32: zstd32
324
325test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy
326test-zstd-nolegacy: zstd-nolegacy
327
328test-zstd test-zstd32 test-zstd-nolegacy: datagen
329	file $(ZSTD)
330	EXE_PREFIX="$(QEMU_SYS)" ZSTD_BIN="$(ZSTD)" DATAGEN_BIN=./datagen ./playTests.sh $(ZSTDRTTEST)
331
332test-fullbench: fullbench datagen
333	$(QEMU_SYS) ./fullbench -i1
334	$(QEMU_SYS) ./fullbench -i1 -P0
335
336test-fullbench32: fullbench32 datagen
337	$(QEMU_SYS) ./fullbench32 -i1
338	$(QEMU_SYS) ./fullbench32 -i1 -P0
339
340test-fuzzer: fuzzer
341	$(QEMU_SYS) ./fuzzer -v $(FUZZERTEST) $(FUZZER_FLAGS)
342
343test-fuzzer-stackmode: MOREFLAGS += -DZSTD_HEAPMODE=0
344test-fuzzer-stackmode: test-fuzzer
345
346test-fuzzer32: fuzzer32
347	$(QEMU_SYS) ./fuzzer32 -v $(FUZZERTEST) $(FUZZER_FLAGS)
348
349test-zbuff: zbufftest
350	$(QEMU_SYS) ./zbufftest $(ZSTREAM_TESTTIME)
351
352test-zbuff32: zbufftest32
353	$(QEMU_SYS) ./zbufftest32 $(ZSTREAM_TESTTIME)
354
355test-zstream: zstreamtest
356	$(QEMU_SYS) ./zstreamtest -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
357	$(QEMU_SYS) ./zstreamtest --newapi -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
358
359test-zstream32: zstreamtest32
360	$(QEMU_SYS) ./zstreamtest32 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
361
362test-longmatch: longmatch
363	$(QEMU_SYS) ./longmatch
364
365test-bigdict: bigdict
366	$(QEMU_SYS) ./bigdict
367
368test-invalidDictionaries: invalidDictionaries
369	$(QEMU_SYS) ./invalidDictionaries
370
371test-legacy: legacy
372	$(QEMU_SYS) ./legacy
373
374test-decodecorpus: decodecorpus
375	$(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME)
376
377test-decodecorpus-cli: decodecorpus
378	@echo "\n ---- decodecorpus basic cli tests ----"
379	@mkdir testdir
380	./decodecorpus -n5 -otestdir -ptestdir
381	@cd testdir && \
382	$(ZSTD) -d z000000.zst -o tmp0 && \
383	$(ZSTD) -d z000001.zst -o tmp1 && \
384	$(ZSTD) -d z000002.zst -o tmp2 && \
385	$(ZSTD) -d z000003.zst -o tmp3 && \
386	$(ZSTD) -d z000004.zst -o tmp4 && \
387	diff z000000 tmp0 && \
388	diff z000001 tmp1 && \
389	diff z000002 tmp2 && \
390	diff z000003 tmp3 && \
391	diff z000004 tmp4 && \
392	rm ./* && \
393	cd ..
394	@echo "\n ---- decodecorpus dictionary cli tests ----"
395	./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
396	@cd testdir && \
397	$(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \
398	$(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \
399	$(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \
400	$(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \
401	$(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \
402	diff z000000 tmp0 && \
403	diff z000001 tmp1 && \
404	diff z000002 tmp2 && \
405	diff z000003 tmp3 && \
406	diff z000004 tmp4 && \
407	cd ..
408	@rm -rf testdir
409
410test-pool: poolTests
411	$(QEMU_SYS) ./poolTests
412
413test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd
414test-lz4: ZSTD_LZ4 = LD_LIBRARY_PATH=/usr/local/lib ./lz4
415test-lz4: ZSTD_UNLZ4 = LD_LIBRARY_PATH=/usr/local/lib ./unlz4
416test-lz4: zstd decodecorpus datagen
417	[ -f lz4 ] || ln -s $(PRGDIR)/zstd lz4
418	[ -f unlz4 ] || ln -s $(PRGDIR)/zstd unlz4
419
420	./decodecorpus -ptmp
421	# lz4 -> zstd
422	lz4 < tmp | \
423	$(ZSTD) -d | \
424	cmp - tmp
425	lz4 < tmp | \
426	$(ZSTD_UNLZ4) | \
427	cmp - tmp
428	# zstd -> lz4
429	$(ZSTD) --format=lz4 < tmp | \
430	lz4 -d | \
431	cmp - tmp
432	$(ZSTD_LZ4) < tmp | \
433	lz4 -d | \
434	cmp - tmp
435	# zstd -> zstd
436	$(ZSTD) --format=lz4 < tmp | \
437	$(ZSTD) -d | \
438	cmp - tmp
439	# zstd -> zstd
440	$(ZSTD) < tmp | \
441	$(ZSTD) -d | \
442	cmp - tmp
443
444	./datagen -g384KB | $(ZSTD) --format=lz4 | $(ZSTD) -d > /dev/null
445
446	rm tmp lz4 unlz4
447
448endif
449