diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2013-07-06 23:06:37 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2013-07-06 23:06:37 +0000 |
commit | 223f48adba1b0f5ed461be657a11165edc83fcc2 (patch) | |
tree | b2ab384e715848f0764376ed6e0d71bae067f155 /regress/misc | |
parent | d0e1f726220e4d664cce1d940de8d53be2295821 (diff) |
implement some simple check that make sure typedefs don't change in
a bad way on us.
Prompted by some recent work on types.h by guenther, to be fleshed
out as people require.
Diffstat (limited to 'regress/misc')
-rw-r--r-- | regress/misc/Makefile | 4 | ||||
-rw-r--r-- | regress/misc/c++abi/Makefile | 13 | ||||
-rw-r--r-- | regress/misc/c++abi/nm1.C | 31 | ||||
-rw-r--r-- | regress/misc/c++abi/nm1.ref | 27 |
4 files changed, 73 insertions, 2 deletions
diff --git a/regress/misc/Makefile b/regress/misc/Makefile index 12d322c5f4c..05107dc8ce0 100644 --- a/regress/misc/Makefile +++ b/regress/misc/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.4 2012/12/23 15:12:32 kettenis Exp $ +# $OpenBSD: Makefile,v 1.5 2013/07/06 23:06:36 espie Exp $ -SUBDIR+= X11 exceptions objc sse2 +SUBDIR+= X11 c++abi exceptions objc sse2 install: diff --git a/regress/misc/c++abi/Makefile b/regress/misc/c++abi/Makefile new file mode 100644 index 00000000000..d8d1aed97d8 --- /dev/null +++ b/regress/misc/c++abi/Makefile @@ -0,0 +1,13 @@ +# $OpenBSD: Makefile,v 1.1 2013/07/06 23:06:36 espie Exp $ + +REGRESS_TARGETS = check1 + +check1: nm1.out + diff -I 'OpenBSD' -u nm1.out ${.CURDIR}/nm1.ref + +nm1.out: nm1.o + nm -C nm1.o | fgrep witness | sort | sed -e 's/.* T witness_//' >$@ + +CLEANFILES = *.o *.out + +.include <bsd.regress.mk> diff --git a/regress/misc/c++abi/nm1.C b/regress/misc/c++abi/nm1.C new file mode 100644 index 00000000000..2ed1a9bcff0 --- /dev/null +++ b/regress/misc/c++abi/nm1.C @@ -0,0 +1,31 @@ +/* $OpenBSD: nm1.C,v 1.1 2013/07/06 23:06:36 espie Exp $ */ +#include <sys/types.h> +#include <sys/socket.h> + +#define D(T) void witness_##T(T) {} + +D(cpuid_t) +D(dev_t) +D(fixpt_t) +D(fsblkcnt_t) +D(gid_t) +D(id_t) +D(in_addr_t) +D(in_port_t) +D(ino_t) +D(key_t) +D(mode_t) +D(nlink_t) +D(pid_t) +D(rlim_t) +D(sa_family_t) +D(segsz_t) +D(socklen_t) +D(suseconds_t) +D(swblk_t) +D(uid_t) +D(uint64_t) +D(uint32_t) +D(size_t) +D(off_t) +D(useconds_t) diff --git a/regress/misc/c++abi/nm1.ref b/regress/misc/c++abi/nm1.ref new file mode 100644 index 00000000000..63b54dd4fd8 --- /dev/null +++ b/regress/misc/c++abi/nm1.ref @@ -0,0 +1,27 @@ +# $OpenBSDS$ +# reference output, all lines containing OpenBSD are ignored +cpuid_t(unsigned long) +dev_t(int) +fixpt_t(unsigned int) +fsblkcnt_t(unsigned long long) +gid_t(unsigned int) +id_t(unsigned int) +in_addr_t(unsigned int) +in_port_t(unsigned short) +ino_t(unsigned int) +key_t(long) +mode_t(unsigned int) +nlink_t(unsigned int) +pid_t(int) +rlim_t(unsigned long long) +sa_family_t(unsigned char) +segsz_t(int) +socklen_t(unsigned int) +suseconds_t(int) +swblk_t(int) +uid_t(unsigned int) +uint64_t(unsigned long long) +uint32_t(unsigned int) +size_t(unsigned long) +off_t(long long) +useconds_t(unsigned int) |