From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- .../cmd/dtrace/test/tst/common/enum/Makefile.kup | 0 .../common/enum/err.D_DECL_IDRED.EnumSameName.d | 57 ++++++++++++++++++++++ .../common/enum/err.D_UNKNOWN.RepeatIdentifiers.d | 52 ++++++++++++++++++++ .../dtrace/test/tst/common/enum/tst.EnumEquality.d | 56 +++++++++++++++++++++ .../test/tst/common/enum/tst.EnumSameValue.d | 51 +++++++++++++++++++ .../test/tst/common/enum/tst.EnumValAssign.d | 57 ++++++++++++++++++++++ 6 files changed, 273 insertions(+) create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum') diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d new file mode 100644 index 00000000..7e5427a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/* + * ASSERTION: + * Enumerations assigning same or different values to the same identifier in + * different enumerations should throw a compiler error. + * + * SECTION: Type and Constant Definitions/Enumerations + * + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +enum colors { + RED, + GREEN, + BLUE +}; + +enum shades { + RED, + ORANGE, + GREEN, + WHITE +}; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d new file mode 100644 index 00000000..2b4266d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d @@ -0,0 +1,52 @@ +/* + * 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. + */ + +/* + * ASSERTION: + * Repeating the same identifier in the same enumeration will throw a compiler + * error. + * + * SECTION: Type and Constant Definitions/Enumerations + * + * NOTES: + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +enum colors { + RED, + GREEN, + GREEN = 2, + BLUE +}; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d new file mode 100644 index 00000000..cbf9369a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d @@ -0,0 +1,56 @@ +/* + * 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. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the identifiers in different D enumerations at same position for + * equality. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + +#pragma D option quiet + +enum colors { + RED, + GREEN, + BLUE +}; + +enum shades { + WHITE, + BLACK, + YELLOW +}; + + +profile:::tick-1sec +/(WHITE == RED) && (YELLOW == BLUE) && (GREEN == BLACK)/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d new file mode 100644 index 00000000..26a4d504 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d @@ -0,0 +1,51 @@ +/* + * 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. + */ + +/* + * ASSERTION: + * Enumerations assigning the same value to different identifiers in the same + * enumeration should work okay. + * + * SECTION: Type and Constant Definitions/Enumerations + * + * NOTES: + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +enum colors { + RED = 2, + GREEN = 2, + BLUE = 2 +}; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d new file mode 100644 index 00000000..f721c50a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/* + * ASSERTION: + * Test the D enumerations with and without initilialization of the identifiers. + * Also test for values with negative integer assignments, expressions and + * fractions. + * + * SECTION: Type and Constant Definitions/Enumerations + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +enum colors { + RED, + ORANGE = 5 + 5, + YELLOW = 2, + GREEN, + BLUE = GREEN + ORANGE, + PINK = 5/4, + INDIGO = -2, + VIOLET +}; + +profile:::tick-1sec +/(0 == RED) && (10 == ORANGE) && (2 == YELLOW) && (3 == GREEN) && + (13 == BLUE) && (1 == PINK) && (-2 == INDIGO) && (-1 == VIOLET)/ +{ + exit(0); +} -- cgit v1.2.3