]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d
MFC r368207,368607:
[FreeBSD/stable/10.git] / cddl / contrib / opensolaris / cmd / dtrace / test / tst / common / cg / err.baddif.d
1 /*
2  * CDDL HEADER START
3  *
4  * This file and its contents are supplied under the terms of the
5  * Common Development and Distribution License ("CDDL"), version 1.0.
6  * You may only use this file in accordance with the terms of version
7  * 1.0 of the CDDL.
8  *
9  * A full copy of the text of the CDDL should have accompanied this
10  * source.  A copy of the CDDL is also available via the Internet at
11  * http://www.illumos.org/license/CDDL.
12  *
13  * CDDL HEADER END
14  */
15
16 /*
17  * Copyright (c) 2012 by Delphix. All rights reserved.
18  */
19
20 /*
21  * Compile some code that requires exactly 9 registers. This should generate
22  * invalid DIF because the kernel will flag the fact that we're using more
23  * registers than are available internally.
24  *
25  * Changes to the code generator might cause this test to succeeed in which
26  * case the code should be changed to another sequence that exhausts the
27  * available internal registers.
28  *
29  * Note that this and err.D_NOREG.noreg.d should be kept in sync.
30  */
31
32 #pragma D option iregs=9
33
34 BEGIN
35 {
36         a = 4;
37         trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) *
38             ((a + a) * (a + a)))))));
39 }
40
41 BEGIN
42 {
43         exit(0);
44 }