tst.nullassign.d revision 302408
138451Smsmith/*
238451Smsmith * CDDL HEADER START
338451Smsmith *
438451Smsmith * The contents of this file are subject to the terms of the
538451Smsmith * Common Development and Distribution License (the "License").
638451Smsmith * You may not use this file except in compliance with the License.
738451Smsmith *
838451Smsmith * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
938451Smsmith * or http://www.opensolaris.org/os/licensing.
1038451Smsmith * See the License for the specific language governing permissions
1138451Smsmith * and limitations under the License.
1238451Smsmith *
1338451Smsmith * When distributing Covered Code, include this CDDL HEADER in each
1438451Smsmith * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1538451Smsmith * If applicable, add the following below this CDDL HEADER, with the
1638451Smsmith * fields enclosed by brackets "[]" replaced with your own identifying
1738451Smsmith * information: Portions Copyright [yyyy] [name of copyright owner]
1838451Smsmith *
1938451Smsmith * CDDL HEADER END
2038451Smsmith */
2138451Smsmith
2238451Smsmith/*
2338451Smsmith * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2438451Smsmith * Use is subject to license terms.
2538451Smsmith */
2638451Smsmith
2738451Smsmith#pragma ident	"%Z%%M%	%I%	%E% SMI"
2838451Smsmith
2938451Smsmith#pragma D option quiet
3038451Smsmith
3138451SmsmithBEGIN
3238451Smsmith{
3338451Smsmith	die = "Die";
3438451Smsmith	tap = ", SystemTap, ";
3538451Smsmith	the = "The";
3638451Smsmith}
3738451Smsmith
3838451SmsmithBEGIN
3938451Smsmith{
4038451Smsmith	phrase = strjoin(die, tap);
4138451Smsmith	phrase = strjoin(phrase, die);
4238451Smsmith	expected = "Die, SystemTap, Die";
4338451Smsmith}
4438451Smsmith
4538451SmsmithBEGIN
4638451Smsmith/phrase != expected/
4738451Smsmith{
4838451Smsmith	printf("global: expected '%s', found '%s'\n", expected, phrase);
4938451Smsmith	exit(1);
5038451Smsmith}
5138451Smsmith
5238451SmsmithBEGIN
5338451Smsmith{
5438451Smsmith	this->phrase = strjoin(the, tap);
5538451Smsmith}
5638451Smsmith
5738451SmsmithBEGIN
5838451Smsmith{
5938451Smsmith	this->phrase = strjoin(this->phrase, the);
6038451Smsmith	expected = "The, SystemTap, The";
6138451Smsmith}
6238451Smsmith
6384221SdillonBEGIN
6484221Sdillon/this->phrase != expected/
6584221Sdillon{
6638451Smsmith	printf("clause-local: expected '%s', found '%s'\n",
6738451Smsmith	    expected, this->phrase);
6838451Smsmith	exit(2);
6965470Smsmith}
7038451Smsmith
7182526SjdpBEGIN
7265470Smsmith{
7338451Smsmith	phrase = NULL;
7465470Smsmith	this->phrase = NULL;
7565470Smsmith}
7665470Smsmith
7765470SmsmithBEGIN
7838451Smsmith/phrase != NULL/
7965470Smsmith{
8065470Smsmith	printf("expected global to be NULL\n");
8165470Smsmith	exit(3);
8265470Smsmith}
8365470Smsmith
8465470SmsmithBEGIN
8565470Smsmith/this->phrase != NULL/
8665470Smsmith{
8765470Smsmith	printf("expected clause-local to be NULL\n");
8865470Smsmith	exit(4);
8965470Smsmith}
9065470Smsmith
9165470SmsmithBEGIN
9265470Smsmith{
9365470Smsmith	exit(0);
9438451Smsmith}
9565470Smsmith