diff options
Diffstat (limited to 'roms/u-boot/test/stdint')
-rw-r--r-- | roms/u-boot/test/stdint/int-types.c | 12 | ||||
-rwxr-xr-x | roms/u-boot/test/stdint/test-includes.sh | 56 |
2 files changed, 68 insertions, 0 deletions
diff --git a/roms/u-boot/test/stdint/int-types.c b/roms/u-boot/test/stdint/int-types.c new file mode 100644 index 000000000..f6d09e864 --- /dev/null +++ b/roms/u-boot/test/stdint/int-types.c @@ -0,0 +1,12 @@ +#include <common.h> + +int test_types(void) +{ + uintptr_t uintptr = 0; + uint64_t uint64 = 0; + u64 u64_val = 0; + + printf("uintptr = %lu\n", uintptr); + printf("uint64 = %llu\n", uint64); + printf("u64 = %llu\n", u64_val); +} diff --git a/roms/u-boot/test/stdint/test-includes.sh b/roms/u-boot/test/stdint/test-includes.sh new file mode 100755 index 000000000..1db8515e8 --- /dev/null +++ b/roms/u-boot/test/stdint/test-includes.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Test script to check uintptr_t and 64-bit types for warnings +# +# It builds a few boards with different toolchains. If there are no warnings +# then all is well. +# +# Usage: +# +# Make sure that your toolchains are correct at the bottom of this file +# +# Then: +# ./test/stdint/test-includes.sh + +out=/tmp/test-includes.tmp + +try_test() { + local board=$1 + local arch=$2 + local soc=$3 + local gcc=$4 + local flags="$5" + + echo $@ + if ! which ${gcc} >/dev/null 2>&1; then + echo "Not found: ${gcc}" + return + fi + + rm -rf ${out} + mkdir -p ${out} + touch ${out}/config.h + mkdir -p ${out}/generated + touch ${out}/generated/generic-asm-offsets.h + mkdir -p ${out}/include/asm + ln -s $(pwd)/arch/${arch}/include/asm/arch-${soc} \ + ${out}/include/asm/arch + + cmd="${gcc} -c -D__KERNEL__ ${flags} \ + -fno-builtin -ffreestanding \ + -Iarch/${arch}/include \ + -Iinclude \ + -I${out} -I${out}/include \ + -include configs/${board}.h test/stdint/int-types.c \ + -o /dev/null" + $cmd +} + +try_both() { + try_test $@ +} + +# board arch soc path-to-gcc +try_both sandbox sandbox - gcc +try_both coreboot x86 - x86_64-linux-gnu-gcc +try_both seaboard arm tegra20 /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin/arm-linux-gnueabihf-gcc |