12633Sahl#!/bin/ksh -p 22633Sahl# 32633Sahl# CDDL HEADER START 42633Sahl# 52633Sahl# The contents of this file are subject to the terms of the 62633Sahl# Common Development and Distribution License (the "License"). 72633Sahl# You may not use this file except in compliance with the License. 82633Sahl# 92633Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 102633Sahl# or http://www.opensolaris.org/os/licensing. 112633Sahl# See the License for the specific language governing permissions 122633Sahl# and limitations under the License. 132633Sahl# 142633Sahl# When distributing Covered Code, include this CDDL HEADER in each 152633Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 162633Sahl# If applicable, add the following below this CDDL HEADER, with the 172633Sahl# fields enclosed by brackets "[]" replaced with your own identifying 182633Sahl# information: Portions Copyright [yyyy] [name of copyright owner] 192633Sahl# 202633Sahl# CDDL HEADER END 212633Sahl# 222633Sahl 232633Sahl# 242633Sahl# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 252633Sahl# Use is subject to license terms. 262633Sahl# 272633Sahl 282633Sahl#ident "%Z%%M% %I% %E% SMI" 292633Sahl 302633Sahl## 312633Sahl# 322633Sahl# ASSERTION: 332633Sahl# Using -G option with dtrace utility produces an ELF file containing a 342633Sahl# DTrace program. If the filename used with the -s option does not end 352633Sahl# with .d, and the -o option is not used, then the output ELF file is 362633Sahl# in d.out. 372633Sahl# 382633Sahl# SECTION: dtrace Utility/-G Option 392633Sahl# 402633Sahl## 412633Sahl 422633Sahlscript() 432633Sahl{ 442633Sahl $dtrace -G -s /dev/stdin <<EOF 452633Sahl BEGIN 462633Sahl { 472633Sahl printf("This test should compile.\n"); 482633Sahl exit(0); 492633Sahl } 502633SahlEOF 512633Sahl} 522633Sahl 53*2804Stomeeif [ $# != 1 ]; then 54*2804Stomee echo expected one argument: '<'dtrace-path'>' 55*2804Stomee exit 2 56*2804Stomeefi 57*2804Stomee 58*2804Stomeedtrace=$1 592633Sahlscript 602633Sahlstatus=$? 612633Sahl 622633Sahlif [ "$status" -ne 0 ]; then 632633Sahl echo $tst: dtrace failed 642633Sahl exit $status 652633Sahlfi 662633Sahl 672633Sahlif [ ! -a "d.out" ]; then 682633Sahl echo $tst: file not generated 692633Sahl exit 1 702633Sahlfi 712633Sahl 722633Sahl/usr/bin/rm -f "d.out" 732633Sahlexit 0 74