tst.badguess.ksh revision 211545
10SN/A# 29330SN/A# CDDL HEADER START 30SN/A# 40SN/A# The contents of this file are subject to the terms of the 50SN/A# Common Development and Distribution License (the "License"). 60SN/A# You may not use this file except in compliance with the License. 72362SN/A# 80SN/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 92362SN/A# or http://www.opensolaris.org/os/licensing. 100SN/A# See the License for the specific language governing permissions 110SN/A# and limitations under the License. 120SN/A# 130SN/A# When distributing Covered Code, include this CDDL HEADER in each 140SN/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150SN/A# If applicable, add the following below this CDDL HEADER, with the 160SN/A# fields enclosed by brackets "[]" replaced with your own identifying 170SN/A# information: Portions Copyright [yyyy] [name of copyright owner] 180SN/A# 190SN/A# CDDL HEADER END 200SN/A# 212362SN/A 222362SN/A# 232362SN/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 240SN/A# Use is subject to license terms. 250SN/A# 260SN/A# ident "%Z%%M% %I% %E% SMI" 270SN/A 280SN/Aif [ $# != 1 ]; then 293570SN/A echo expected one argument: '<'dtrace-path'>' 303570SN/A exit 2 313570SN/Afi 323570SN/A 3312808Schegardtrace=$1 340SN/ADIR=/var/tmp/dtest.$$ 350SN/A 360SN/Amkdir $DIR 370SN/Acd $DIR 380SN/A 393570SN/Acat > prov.d <<EOF 403570SN/Aprovider test_prov { 413570SN/A probe go(); 423570SN/A}; 433570SN/AEOF 443570SN/A 453570SN/A$dtrace -h -s prov.d 463570SN/Aif [ $? -ne 0 ]; then 473570SN/A print -u2 "failed to generate header file" 483570SN/A exit 1 493570SN/Afi 503570SN/A 513570SN/Acat > test.c <<EOF 523570SN/A#include <sys/types.h> 533570SN/A#include "prov.h" 543570SN/A 553570SN/Aint 563570SN/Amain(int argc, char **argv) 573570SN/A{ 583570SN/A if (TEST_PROV_GO_ENABLED()) { 593570SN/A TEST_PROV_GO(); 604807SN/A } 613570SN/A} 623570SN/AEOF 6314363Ssdrach 6414363Ssdrachcc -xarch=generic64 -c -o test64.o test.c 6514363Ssdrachif [ $? -ne 0 ]; then 6614363Ssdrach print -u2 "failed to compile test.c 64-bit" 670SN/A exit 1 68fi 69cc -xarch=generic -c -o test32.o test.c 70if [ $? -ne 0 ]; then 71 print -u2 "failed to compile test.c 32-bit" 72 exit 1 73fi 74 75$dtrace -G -s prov.d test32.o test64.o 76if [ $? -eq 0 ]; then 77 print -u2 "DOF generation failed to generate a warning" 78 exit 1 79fi 80 81cd / 82/bin/rm -rf $DIR 83 84exit 0 85