tst.PreprocessorStatement.d.ksh revision 178476
1251881Speter#!/bin/ksh -p
2251881Speter#
3251881Speter# CDDL HEADER START
4251881Speter#
5251881Speter# The contents of this file are subject to the terms of the
6251881Speter# Common Development and Distribution License (the "License").
7251881Speter# You may not use this file except in compliance with the License.
8251881Speter#
9251881Speter# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10251881Speter# or http://www.opensolaris.org/os/licensing.
11251881Speter# See the License for the specific language governing permissions
12251881Speter# and limitations under the License.
13251881Speter#
14251881Speter# When distributing Covered Code, include this CDDL HEADER in each
15251881Speter# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16251881Speter# If applicable, add the following below this CDDL HEADER, with the
17251881Speter# fields enclosed by brackets "[]" replaced with your own identifying
18251881Speter# information: Portions Copyright [yyyy] [name of copyright owner]
19251881Speter#
20251881Speter# CDDL HEADER END
21251881Speter#
22251881Speter
23251881Speter#
24251881Speter# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25251881Speter# Use is subject to license terms.
26251881Speter#
27251881Speter
28251881Speter#ident	"%Z%%M%	%I%	%E% SMI"
29251881Speter
30251881Speter##
31251881Speter#
32251881Speter# ASSERTION:
33251881Speter# The -C option is used to run the C preprocessor over D programs before
34251881Speter# compiling them. The -H option used in conjuction with the -C option
35251881Speter# lists the pathnames of the included files to STDERR.
36251881Speter#
37251881Speter# SECTION: dtrace Utility/-C Option;
38251881Speter# 	dtrace Utility/-H Option
39251881Speter#
40251881Speter##
41251881Speter
42251881Speterscript()
43251881Speter{
44251881Speter	$dtrace -CH -s /dev/stdin <<EOF
45251881Speter
46251881Speter#include <stdio.h>
47251881Speter
48251881Speter	BEGIN
49251881Speter	{
50251881Speter		printf("This test should compile\n");
51251881Speter		exit(0);
52251881Speter	}
53251881SpeterEOF
54251881Speter}
55251881Speter
56251881Speterif [ $# != 1 ]; then
57251881Speter	echo expected one argument: '<'dtrace-path'>'
58251881Speter	exit 2
59251881Speterfi
60251881Speter
61251881Speterdtrace=$1
62251881Speter
63251881Speterscript
64status=$?
65
66if [ "$status" -ne 0 ]; then
67	echo $tst: dtrace failed
68fi
69
70exit $status
71