16512 xhci leaks oneshot interrupt IN transfers on pipe reset
[illumos-gate.git] / usr / src / test / libc-tests / tests / quick_exit_order.c
blob2ee6ccad1d849e9d242eea7d8d0080a476aa9909
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2016 Joyent, Inc.
17 * Register functions with quick_exit() and verify that we honor the expected
18 * function call value. We facilitate this by having a global integer and
19 * modifying it to various values in subsequent functions. If we're not called
20 * in reverse order, we should spot the differences.
23 #include <stdlib.h>
24 #include <sys/debug.h>
26 static int qeo_val = 5;
28 static void
29 qeo_fifth(void)
31 VERIFY3S(qeo_val, ==, 5);
32 qeo_val--;
35 static void
36 qeo_fourth(void)
38 VERIFY3S(qeo_val, ==, 4);
39 qeo_val--;
42 static void
43 qeo_third(void)
45 VERIFY3S(qeo_val, ==, 3);
46 qeo_val--;
49 static void
50 qeo_second(void)
52 VERIFY3S(qeo_val, ==, 2);
53 qeo_val--;
56 static void
57 qeo_first(void)
59 VERIFY3S(qeo_val, ==, 1);
60 qeo_val--;
63 static void
64 qeo_zero(void)
66 VERIFY3S(qeo_val, ==, 0);
69 int
70 main(void)
72 VERIFY0(at_quick_exit(qeo_zero));
73 VERIFY0(at_quick_exit(qeo_first));
74 VERIFY0(at_quick_exit(qeo_second));
75 VERIFY0(at_quick_exit(qeo_third));
76 VERIFY0(at_quick_exit(qeo_fourth));
77 VERIFY0(at_quick_exit(qeo_fifth));
78 quick_exit(0);
79 abort();