157718be8SEnji Cooper /* $NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $ */
257718be8SEnji Cooper /*-
357718be8SEnji Cooper * Copyright (c) 2011 The NetBSD Foundation, Inc.
457718be8SEnji Cooper * All rights reserved.
557718be8SEnji Cooper *
657718be8SEnji Cooper * This code is derived from software contributed to The NetBSD Foundation
757718be8SEnji Cooper * by Joerg Sonnenberger.
857718be8SEnji Cooper *
957718be8SEnji Cooper * Redistribution and use in source and binary forms, with or without
1057718be8SEnji Cooper * modification, are permitted provided that the following conditions
1157718be8SEnji Cooper * are met:
1257718be8SEnji Cooper *
1357718be8SEnji Cooper * 1. Redistributions of source code must retain the above copyright
1457718be8SEnji Cooper * notice, this list of conditions and the following disclaimer.
1557718be8SEnji Cooper * 2. Redistributions in binary form must reproduce the above copyright
1657718be8SEnji Cooper * notice, this list of conditions and the following disclaimer in
1757718be8SEnji Cooper * the documentation and/or other materials provided with the
1857718be8SEnji Cooper * distribution.
1957718be8SEnji Cooper *
2057718be8SEnji Cooper * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2157718be8SEnji Cooper * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2257718be8SEnji Cooper * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
2357718be8SEnji Cooper * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
2457718be8SEnji Cooper * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
2557718be8SEnji Cooper * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
2657718be8SEnji Cooper * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2757718be8SEnji Cooper * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2857718be8SEnji Cooper * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2957718be8SEnji Cooper * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
3057718be8SEnji Cooper * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3157718be8SEnji Cooper * SUCH DAMAGE.
3257718be8SEnji Cooper */
3357718be8SEnji Cooper
3457718be8SEnji Cooper #include <sys/cdefs.h>
3557718be8SEnji Cooper __RCSID("$NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
3657718be8SEnji Cooper
37*ff0ba872SEnji Cooper #ifdef __NetBSD__
3857718be8SEnji Cooper #include <sys/tls.h>
395bd73b51SEnji Cooper #endif
4057718be8SEnji Cooper
4157718be8SEnji Cooper #ifdef __HAVE_NO___THREAD
4257718be8SEnji Cooper #define __thread
4357718be8SEnji Cooper #endif
4457718be8SEnji Cooper
4557718be8SEnji Cooper extern __thread int var1;
4657718be8SEnji Cooper extern __thread int var2;
4757718be8SEnji Cooper
4857718be8SEnji Cooper void testf_helper(void);
4957718be8SEnji Cooper
5057718be8SEnji Cooper void
testf_helper(void)5157718be8SEnji Cooper testf_helper(void)
5257718be8SEnji Cooper {
5357718be8SEnji Cooper var1 = -1;
5457718be8SEnji Cooper var2 = -1;
5557718be8SEnji Cooper }
56