xref: /openbsd-src/regress/libexec/ld.so/randomdata/prog/prog.c (revision 75795c7bb7900317a5c55bdb22c0c5a0ef978a42)
1*75795c7bSderaadt /*	$OpenBSD: prog.c,v 1.3 2017/08/01 13:05:55 deraadt Exp $	*/
2b3669013Smatthew #include <sys/types.h>
3b3669013Smatthew #include <assert.h>
4b3669013Smatthew 
5b3669013Smatthew extern int64_t getaavalue(void);
6b3669013Smatthew 
7*75795c7bSderaadt int64_t progvalue __attribute__((section(".openbsd.randomdata")));
8b3669013Smatthew 
9b3669013Smatthew int
main()10b3669013Smatthew main()
11b3669013Smatthew {
12b3669013Smatthew 	int64_t aavalue = getaavalue();
13b3669013Smatthew 
14b3669013Smatthew 	assert(progvalue != 0);
15b3669013Smatthew 	assert(aavalue != 0);
16b3669013Smatthew 	assert(progvalue != aavalue);
17b3669013Smatthew 	return (0);
18b3669013Smatthew }
19