xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/i386/error/tst.DTRACEFLT_DIVZERO.d (revision 82d2d142300e27cbe46f9fd3731e9d280b2c66e8)
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.
6  *
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.
10  */
11 
12 /*
13  * Copyright (c) 2016, Joyent, Inc. All rights reserved.
14  */
15 
16 BEGIN
17 {
18 	v = 0x8000000000000000LL;
19 	print((long)v % -1);
20 }
21 
22 ERROR
23 /arg4 == DTRACEFLT_DIVZERO/
24 {
25 	exit(0);
26 }
27 
28 ERROR
29 {
30 	printf("unexpected error code %d", arg4);
31 	exit(1);
32 }
33 
34 BEGIN
35 {
36 	printf("did not get expected error");
37 	exit(1);
38 }
39