summaryrefslogtreecommitdiff
path: root/regress/libexec/ld.so/randomdata/prog/prog.c
blob: 34b8f3ed382ff612a24a23c3281452f6592892f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*	$OpenBSD: prog.c,v 1.2 2015/01/20 04:41:01 krw Exp $	*/
#include <sys/types.h>
#include <assert.h>

extern int64_t getaavalue(void);

static int64_t progvalue __attribute__((section(".openbsd.randomdata")));

int
main()
{
	int64_t aavalue = getaavalue();

	assert(progvalue != 0);
	assert(aavalue != 0);
	assert(progvalue != aavalue);
	return (0);
}