5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews/* Copyright (c) 2009 The NetBSD Foundation, Inc.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * All rights reserved.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Redistribution and use in source and binary forms, with or without
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * modification, are permitted provided that the following conditions
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * are met:
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 1. Redistributions of source code must retain the above copyright
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * notice, this list of conditions and the following disclaimer.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 2. Redistributions in binary form must reproduce the above copyright
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * notice, this list of conditions and the following disclaimer in the
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * documentation and/or other materials provided with the distribution.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews#if defined(ATF_C_H_BUILD_H)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# error "Cannot include h_build.h more than once."
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews#else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# define ATF_C_H_BUILD_H
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews#endif
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews/* ---------------------------------------------------------------------
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Test case data.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * --------------------------------------------------------------------- */
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsstatic struct c_o_test {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *msg;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cc;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cflags;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cppflags;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *sfile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *ofile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews bool hasoptargs;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const optargs[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const expargv[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews} c_o_tests[] = {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "No flags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Multi-word program name",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc -foo",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-foo", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1 -f2 -f3 -f4-f5",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cppflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1 -f2 -f3 -f4-f5",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cflags and cppflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f2",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cflags, cppflags and optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f2",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cc", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews};
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsstatic struct cpp_test {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *msg;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cpp;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cppflags;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *sfile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *ofile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews bool hasoptargs;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const optargs[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const expargv[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews} cpp_tests[] = {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "No flags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp", "-o", "test.out", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Multi-word program name",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp -foo",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp", "-foo", "-o", "test.out", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cppflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1 -f2 -f3 -f4-f5",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp", "-o1", "-o2", "-o", "test.out", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cppflags and optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.out",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "cpp", "-f1", "-o1", "-o2", "-o", "test.out", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews};
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsstatic struct cxx_o_test {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *msg;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cxx;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cxxflags;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *cppflags;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *sfile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *ofile;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews bool hasoptargs;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const optargs[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews const char *const expargv[16];
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews} cxx_o_tests[] = {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "No flags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Multi-word program name",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++ -foo",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-foo", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cxxflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1 -f2 -f3 -f4-f5",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cppflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1 -f2 -f3 -f4-f5",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cxxflags and cppflags",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f2",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "Some cxxflags, cppflags and optional arguments",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f2",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-f1",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.c",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews true,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-o1", "-o2", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "c++", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "-c", "test.c", NULL
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews NULL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews false,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews { NULL },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews },
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews};
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews