mirror of
https://github.com/Cyan4973/xxHash.git
synced 2026-01-19 04:52:10 +00:00
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -37,15 +37,11 @@
|
||||
# elapsed time.
|
||||
#
|
||||
# Todos:
|
||||
# - [ ] Linux: Add native ARM runner.
|
||||
# - [ ] Linux: Add native ARM64 runner.
|
||||
# - [ ] Linux: Add native PPC64LE runner.
|
||||
# - [ ] Linux: Add native S390X runner.
|
||||
# - [ ] Windows: Add VS2013.
|
||||
# - [ ] Windows: Add VS2015.
|
||||
# - [ ] Windows: Add clang for msys2.
|
||||
# - [ ] Windows: Add native or emulated ARM runner.
|
||||
# - [ ] Windows: Add native or emulated ARM64 runner.
|
||||
# - [ ] Windows: Add native or emulated ARM64 runner (note: currently unreliable)
|
||||
|
||||
|
||||
# Name of the workflow is also displayed as a SVG badge
|
||||
@@ -167,6 +163,11 @@ jobs:
|
||||
run: |
|
||||
make clean test-all
|
||||
|
||||
- name: test-alias
|
||||
run: |
|
||||
make clean
|
||||
make -C tests test_alias
|
||||
|
||||
|
||||
ubuntu-consistency:
|
||||
name: Linux x64 check results consistency
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ dispatch
|
||||
tests/generate_unicode_test
|
||||
tests/sanity_test
|
||||
tests/sanity_test_vectors_generator
|
||||
tests/test_alias
|
||||
fuzzer
|
||||
|
||||
# Mac OS-X artefacts
|
||||
|
||||
@@ -50,7 +50,7 @@ C_SRCDIRS = . .. ../cli
|
||||
include ../build/make/multiconf.make
|
||||
|
||||
.PHONY: all
|
||||
all: test
|
||||
all: test test_alias
|
||||
|
||||
.PHONY: test
|
||||
test: test_multiInclude test_unicode test_sanity
|
||||
@@ -127,6 +127,10 @@ sanity_test_vectors.h: sanity_test_vectors_generator
|
||||
multiInclude_withxxhash:
|
||||
$(eval $(call c_program,multiInclude_withxxhash,multiInclude.o xxhash.o))
|
||||
|
||||
test_alias: CPPFLAGS += -I..
|
||||
test_alias: CFLAGS += -O3 -Werror
|
||||
$(eval $(call c_program,test_alias,test_alias.o))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@$(RM) *.o
|
||||
|
||||
18
tests/test_alias.c
Normal file
18
tests/test_alias.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#define XXH_INLINE_ALL
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include "xxhash.h"
|
||||
|
||||
int main() {
|
||||
// it seems this has to be exactly 24 bytes.
|
||||
union {
|
||||
char x[24];
|
||||
// force 8-byte alignment without making
|
||||
// aliasable with uint64_t.
|
||||
void *y[3];
|
||||
} data = {.x = "garblegarblegarblegarble"};
|
||||
uint64_t hash = XXH64(&data, sizeof(data), 0);
|
||||
printf("%016"PRIx64"\n", hash);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user