t_section.sh revision 1.1
11.1Suebayasi#	$NetBSD: t_section.sh,v 1.1 2014/11/14 13:30:48 uebayasi Exp $
21.1Suebayasi#
31.1Suebayasi# Copyright (c) 2014 The NetBSD Foundation, Inc.
41.1Suebayasi# All rights reserved.
51.1Suebayasi#
61.1Suebayasi# Redistribution and use in source and binary forms, with or without
71.1Suebayasi# modification, are permitted provided that the following conditions
81.1Suebayasi# are met:
91.1Suebayasi# 1. Redistributions of source code must retain the above copyright
101.1Suebayasi#    notice, this list of conditions and the following disclaimer.
111.1Suebayasi# 2. Redistributions in binary form must reproduce the above copyright
121.1Suebayasi#    notice, this list of conditions and the following disclaimer in the
131.1Suebayasi#    documentation and/or other materials provided with the distribution.
141.1Suebayasi#
151.1Suebayasi# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
161.1Suebayasi# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
171.1Suebayasi# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
181.1Suebayasi# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
191.1Suebayasi# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
201.1Suebayasi# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
211.1Suebayasi# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
221.1Suebayasi# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
231.1Suebayasi# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
241.1Suebayasi# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
251.1Suebayasi# POSSIBILITY OF SUCH DAMAGE.
261.1Suebayasi#
271.1Suebayasi
281.1Suebayasiatf_test_case startstop
291.1Suebayasistartstop_head() {
301.1Suebayasi	atf_set "descr" "check if __start_*/__stop_* symbols are generated"
311.1Suebayasi	atf_set "require.progs" "cc"
321.1Suebayasi}
331.1Suebayasi
341.1Suebayasistartstop_body() {
351.1Suebayasi	cat > test.c << EOF
361.1Suebayasi#include <sys/cdefs.h>
371.1Suebayasiint i __section("hoge");
381.1Suebayasiextern int __start_hoge[], __stop_hoge[];
391.1Suebayasiint main = __start_hoge[0] + __stop_hoge[0];
401.1SuebayasiEOF
411.1Suebayasi	atf_check -s exit:0 -o ignore -e ignore cc -o test test.c
421.1Suebayasi}
431.1Suebayasi
441.1Suebayasiatf_init_test_cases()
451.1Suebayasi{
461.1Suebayasi
471.1Suebayasi	atf_add_test_case startstop
481.1Suebayasi}
49