diff options
author | Paul Dagnelie <paul.dagnelie@delphix.com> | 2014-04-14 21:08:40 -0800 |
---|---|---|
committer | Christopher Siden <chris@delphix.com> | 2014-04-14 22:08:41 -0700 |
commit | 7266c4fdd3d819c74f84745da19a4eb34bd75f2d (patch) | |
tree | 4903c714ae274c89e11e01c7cee6732799eafb92 /usr/src | |
parent | f5b1cef2488dc579cb4312d49164f10debf8e97d (diff) | |
download | illumos-joyent-7266c4fdd3d819c74f84745da19a4eb34bd75f2d.tar.gz |
4210 unsigned unsigned short short is valid in dtrace
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
9 files changed, 330 insertions, 2 deletions
diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr1.d b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr1.d new file mode 100644 index 0000000000..64b7263918 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr1.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Short can be used at most once. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((short short int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr2.d b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr2.d new file mode 100644 index 0000000000..9df10bae91 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr2.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Signed can be used at most once. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((signed signed int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr3.d b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr3.d new file mode 100644 index 0000000000..56f4eabeac --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr3.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Unsigned can be used at most once. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((unsigned unsigned int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr4.d b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr4.d new file mode 100644 index 0000000000..03656defc1 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr4.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Long can only be used at most twice + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((long long long int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr5.d b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr5.d new file mode 100644 index 0000000000..37019a0b44 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.rptdattr5.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Long can only be used at most twice + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((long long long long int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt1.d b/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt1.d new file mode 100644 index 0000000000..9025d97541 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt1.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Long and short attributes can't be used together + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((long short int)arg0); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt2.d b/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt2.d new file mode 100644 index 0000000000..449550966f --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/types/err.EDT_NOTYPE.cmbdatt2.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ + +/* + * ASSERTION: + * Signed and unsigned attributes can't be used together + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +BEGIN +{ + trace((signed unsigned int)arg0); + exit(0); +} diff --git a/usr/src/lib/libdtrace/common/dt_decl.c b/usr/src/lib/libdtrace/common/dt_decl.c index 4e99ff4c9f..bbb561d027 100644 --- a/usr/src/lib/libdtrace/common/dt_decl.c +++ b/usr/src/lib/libdtrace/common/dt_decl.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -267,6 +267,26 @@ dt_decl_attr(ushort_t attr) return (ddp); } + if ((attr & DT_DA_LONG) && (ddp->dd_attr & DT_DA_LONGLONG)) { + xyerror(D_DECL_COMBO, "the attribute 'long' may only " + "be used at most twice in a declaration"); + } + + if ((attr & DT_DA_SHORT) && (ddp->dd_attr & DT_DA_SHORT)) { + xyerror(D_DECL_COMBO, "the attribute 'short' may only be " + "used at most once in a declaration"); + } + + if ((attr & DT_DA_SIGNED) && (ddp->dd_attr & DT_DA_SIGNED)) { + xyerror(D_DECL_COMBO, "the attribute 'signed' may only be " + "used at most once in a declaration"); + } + + if ((attr & DT_DA_UNSIGNED) && (ddp->dd_attr & DT_DA_UNSIGNED)) { + xyerror(D_DECL_COMBO, "the attribute 'unsigned' may only be " + "used at most once in a declaration"); + } + if (attr == DT_DA_LONG && (ddp->dd_attr & DT_DA_LONG)) { ddp->dd_attr &= ~DT_DA_LONG; attr = DT_DA_LONGLONG; diff --git a/usr/src/pkg/manifests/system-dtrace-tests.mf b/usr/src/pkg/manifests/system-dtrace-tests.mf index 18bc29e6b8..0974627444 100644 --- a/usr/src/pkg/manifests/system-dtrace-tests.mf +++ b/usr/src/pkg/manifests/system-dtrace-tests.mf @@ -21,7 +21,7 @@ # # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012, 2014 by Delphix. All rights reserved. # set name=pkg.fmri value=pkg:/system/dtrace/tests@$(PKGVERS) @@ -1944,6 +1944,11 @@ file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_CHARATTR.badtype3.d \ mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.badtype4.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.badtype5.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.rptdattr1.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.rptdattr2.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.rptdattr3.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.rptdattr4.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_COMBO.rptdattr5.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_ENCONST.badeval.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d mode=0444 @@ -1968,6 +1973,8 @@ file path=opt/SUNWdtrt/tst/common/types/err.D_UNKNOWN.dupenum.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_UNKNOWN.dupstruct.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d \ mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.EDT_NOTYPE.cmbdatt1.d mode=0444 +file path=opt/SUNWdtrt/tst/common/types/err.EDT_NOTYPE.cmbdatt2.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/tst.assignops.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/tst.badshiftops.d mode=0444 file path=opt/SUNWdtrt/tst/common/types/tst.basics.d mode=0444 |