diff options
author | Mark Johnston <markj@FreeBSD.org> | 2013-05-19 17:14:36 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2013-05-19 17:14:36 +0000 |
commit | ba6cafe2658af1c21976319a42457aa226555a86 (patch) | |
tree | 191b586f26c3dbc072d2f8d29909688c6d134bdb /cddl/contrib/opensolaris/cmd | |
parent | 0d8d860f6e10fda66467ab0602d2829964be741e (diff) | |
parent | f8c38c2b9aa27b6399e9c9d91209ec50fde27a8c (diff) | |
download | src-ba6cafe2658af1c21976319a42457aa226555a86.tar.gz src-ba6cafe2658af1c21976319a42457aa226555a86.zip |
Re-introduce another part of r249367. This commit fixes a register leak in
dt_cg_ptrsize() and generally cleans up some of the error handling around
register allocation.
This change corresponds to part of illumos-gate commit e5803b76927480:
3025 register leak in D code generation
Reviewed by: pfg
Obtained from: illumos
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=250812
Diffstat (limited to 'cddl/contrib/opensolaris/cmd')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d | 41 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d | 44 |
2 files changed, 85 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d new file mode 100644 index 000000000000..636e5686433d --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Compile some code that requires exactly 9 registers. This should run out + * of registers. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.baddif.d should be kept in sync. + */ + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d new file mode 100644 index 000000000000..d84934823354 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Compile some code that requires exactly 9 registers. This should generate + * invalid DIF because the kernel will flag the fact that we're using more + * registers than are available internally. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.D_NOREG.noreg.d should be kept in sync. + */ + +#pragma D option iregs=9 + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} |