xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh (revision 6390:2262f1092e41)
1*6390Sahl#
2*6390Sahl# CDDL HEADER START
3*6390Sahl#
4*6390Sahl# The contents of this file are subject to the terms of the
5*6390Sahl# Common Development and Distribution License (the "License").
6*6390Sahl# You may not use this file except in compliance with the License.
7*6390Sahl#
8*6390Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*6390Sahl# or http://www.opensolaris.org/os/licensing.
10*6390Sahl# See the License for the specific language governing permissions
11*6390Sahl# and limitations under the License.
12*6390Sahl#
13*6390Sahl# When distributing Covered Code, include this CDDL HEADER in each
14*6390Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*6390Sahl# If applicable, add the following below this CDDL HEADER, with the
16*6390Sahl# fields enclosed by brackets "[]" replaced with your own identifying
17*6390Sahl# information: Portions Copyright [yyyy] [name of copyright owner]
18*6390Sahl#
19*6390Sahl# CDDL HEADER END
20*6390Sahl#
21*6390Sahl
22*6390Sahl#
23*6390Sahl# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*6390Sahl# Use is subject to license terms.
25*6390Sahl#
26*6390Sahl# ident	"%Z%%M%	%I%	%E% SMI"
27*6390Sahl
28*6390Sahlif [ $# != 1 ]; then
29*6390Sahl	echo expected one argument: '<'dtrace-path'>'
30*6390Sahl	exit 2
31*6390Sahlfi
32*6390Sahl
33*6390Sahllibdir=${TMPDIR:-/tmp}/libdep.$$
34*6390Sahldtrace=$1
35*6390Sahl
36*6390Sahlsetup_libs()
37*6390Sahl{
38*6390Sahl        mkdir $libdir
39*6390Sahl        cat > $libdir/liba.$$.d <<EOF
40*6390Sahl#pragma D depends_on library libb.$$.d
41*6390Sahl
42*6390Sahlinline int foo = bar;
43*6390SahlEOF
44*6390Sahl        cat > $libdir/libb.$$.d <<EOF
45*6390Sahl#pragma D depends_on module doogle_knows_all_probes
46*6390Sahl
47*6390Sahlinline int bar = 0xd0061e;
48*6390SahlEOF
49*6390Sahl}
50*6390Sahl
51*6390Sahl
52*6390Sahlsetup_libs
53*6390Sahl
54*6390Sahl$dtrace -L$libdir -e
55*6390Sahl
56*6390Sahlstatus=$?
57*6390Sahlrm -rf $libdir
58*6390Sahlreturn $status
59