1 /* Copyright (c) 2009 The NetBSD Foundation, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
14 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
20 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
24 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
26 #if defined(ATF_C_H_BUILD_H)
27 # error "Cannot include h_build.h more than once."
29 # define ATF_C_H_BUILD_H
32 /* ---------------------------------------------------------------------
34 * --------------------------------------------------------------------- */
36 static struct c_o_test {
44 const char *const optargs[16];
45 const char *const expargv[16];
59 "cc", "-o", "test.o", "-c", "test.c", NULL
64 "Multi-word program name",
75 "cc", "-foo", "-o", "test.o", "-c", "test.c", NULL
91 "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
100 "-f1 -f2 -f3 -f4-f5",
108 "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
114 "Some cflags and cppflags",
125 "cc", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
130 "Some optional arguments",
141 "cc", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
146 "Some cflags, cppflags and optional arguments",
157 "cc", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",
175 static struct cpp_test {
178 const char *cppflags;
182 const char *const optargs[16];
183 const char *const expargv[16];
196 "cpp", "-o", "test.out", "test.c", NULL
201 "Multi-word program name",
211 "cpp", "-foo", "-o", "test.out", "test.c", NULL
218 "-f1 -f2 -f3 -f4-f5",
226 "cpp", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.out",
232 "Some optional arguments",
242 "cpp", "-o1", "-o2", "-o", "test.out", "test.c", NULL
247 "Some cppflags and optional arguments",
257 "cpp", "-f1", "-o1", "-o2", "-o", "test.out", "test.c", NULL
273 static struct cxx_o_test {
276 const char *cxxflags;
277 const char *cppflags;
281 const char *const optargs[16];
282 const char *const expargv[16];
296 "c++", "-o", "test.o", "-c", "test.c", NULL
301 "Multi-word program name",
312 "c++", "-foo", "-o", "test.o", "-c", "test.c", NULL
319 "-f1 -f2 -f3 -f4-f5",
328 "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
337 "-f1 -f2 -f3 -f4-f5",
345 "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
351 "Some cxxflags and cppflags",
362 "c++", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
367 "Some optional arguments",
378 "c++", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
383 "Some cxxflags, cppflags and optional arguments",
394 "c++", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",