summaryrefslogtreecommitdiff
path: root/tools/perf/config/feature-checks/test-on-exit.c
blob: 8f64ed3a58d9aed014500dc4895922229dde4939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

static void exit_fn(int status, void *__data)
{
	printf("exit status: %d, data: %d\n", status, *(int *)__data);
}

static int data = 123;

int main(void)
{
	on_exit(exit_fn, &data);

	return 321;
}