/* gospec.c -- Specific flags and argument handling of the gcc Go front end.
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
/* Whether the -o option was used. */
bool saw_opt_o = false;
+ /* Whether the -S option was used. */
+ bool saw_opt_S = false;
+
/* The first input file with an extension of .go. */
const char *first_go_file = NULL;
break;
case OPT_c:
- case OPT_S:
case OPT_E:
case OPT_M:
case OPT_MM:
library = -1;
break;
+ case OPT_S:
+ saw_opt_S = true;
+ library = -1;
+ break;
+
case OPT_o:
saw_opt_o = true;
break;
alen = baselen + 3;
out = XNEWVEC (char, alen);
memcpy (out, base, baselen);
- /* The driver will convert .o to some other suffix if
- appropriate. */
+ /* The driver will convert .o to some other suffix (e.g., .obj)
+ if appropriate. */
out[baselen] = '.';
- out[baselen + 1] = 'o';
+ if (saw_opt_S)
+ out[baselen + 1] = 's';
+ else
+ out[baselen + 1] = 'o';
out[baselen + 2] = '\0';
generate_option (OPT_o, out, 1, CL_DRIVER,
&new_decoded_options[j]);