tst.nullassign.d revision 2633:71bab08d24b2
1169689Skan/*
2169689Skan * CDDL HEADER START
3169689Skan *
4169689Skan * The contents of this file are subject to the terms of the
5169689Skan * Common Development and Distribution License (the "License").
6169689Skan * You may not use this file except in compliance with the License.
7169689Skan *
8169689Skan * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9169689Skan * or http://www.opensolaris.org/os/licensing.
10169689Skan * See the License for the specific language governing permissions
11169689Skan * and limitations under the License.
12169689Skan *
13169689Skan * When distributing Covered Code, include this CDDL HEADER in each
14169689Skan * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15169689Skan * If applicable, add the following below this CDDL HEADER, with the
16169689Skan * fields enclosed by brackets "[]" replaced with your own identifying
17169689Skan * information: Portions Copyright [yyyy] [name of copyright owner]
18169689Skan *
19169689Skan * CDDL HEADER END
20169689Skan */
21169689Skan
22169689Skan/*
23169689Skan * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24169689Skan * Use is subject to license terms.
25169689Skan */
26169689Skan
27169689Skan#pragma ident	"%Z%%M%	%I%	%E% SMI"
28169689Skan
29169689Skan#pragma D option quiet
30169689Skan
31169689SkanBEGIN
32169689Skan{
33169689Skan	die = "Die";
34169689Skan	tap = ", SystemTap, ";
35169689Skan	the = "The";
36169689Skan}
37169689Skan
38169689SkanBEGIN
39169689Skan{
40169689Skan	phrase = strjoin(die, tap);
41169689Skan	phrase = strjoin(phrase, die);
42169689Skan	expected = "Die, SystemTap, Die";
43169689Skan}
44169689Skan
45169689SkanBEGIN
46169689Skan/phrase != expected/
47{
48	printf("global: expected '%s', found '%s'\n", expected, phrase);
49	exit(1);
50}
51
52BEGIN
53{
54	this->phrase = strjoin(the, tap);
55}
56
57BEGIN
58{
59	this->phrase = strjoin(this->phrase, the);
60	expected = "The, SystemTap, The";
61}
62
63BEGIN
64/this->phrase != expected/
65{
66	printf("clause-local: expected '%s', found '%s'\n",
67	    expected, this->phrase);
68	exit(2);
69}
70
71BEGIN
72{
73	phrase = NULL;
74	this->phrase = NULL;
75}
76
77BEGIN
78/phrase != NULL/
79{
80	printf("expected global to be NULL\n");
81	exit(3);
82}
83
84BEGIN
85/this->phrase != NULL/
86{
87	printf("expected clause-local to be NULL\n");
88	exit(4);
89}
90
91BEGIN
92{
93	exit(0);
94}
95