47 if (producer != NULL &&
startswith (producer,
"GNU "))
62 cs = &producer[strlen (
"GNU ")];
63 while (*cs && !isspace (*cs))
65 if (*cs && isspace (*cs))
67 if (sscanf (cs,
"%d.%d", major, minor) == 2)
81 if (producer == NULL || !
startswith (producer,
"Intel(R)"))
95 const char *cs = strstr (producer,
"Version");
100 int intermediate = 0;
101 int nof = sscanf (cs,
"%d.%d.%d.%*d", major, &intermediate, minor);
112 *minor = intermediate;
117 static bool warning_printed =
false;
119 if (!warning_printed)
121 warning (
_(
"Could not recognize version of Intel Compiler in: \"%s\""),
123 warning_printed =
true;
128 #if defined GDB_SELF_TEST 133 producer_parsing_tests ()
138 static const char icc_no_version[] =
"Intel(R) foo bar";
140 int major = 0, minor = 0;
146 static const char extern_f_14_1[] =
"\ 147 Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on \ 149 Version 14.0.1.074 Build 20130716";
151 int major = 0, minor = 0;
153 && major == 14 && minor == 1);
158 static const char intern_f_14[] =
"\ 159 Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on \ 163 int major = 0, minor = 0;
165 && major == 14 && minor == 0);
170 static const char intern_c_14[] =
"\ 171 Intel(R) C++ Intel(R) 64 Compiler XE for applications running on \ 174 int major = 0, minor = 0;
176 && major == 14 && minor == 0);
181 static const char intern_c_18[] =
"\ 182 Intel(R) C++ Intel(R) 64 Compiler for applications running on \ 185 int major = 0, minor = 0;
187 && major == 18 && minor == 0);
191 static const char gnu[] =
"GNU C 4.7.2";
194 int major = 0, minor = 0;
196 && major == 4 && minor == 7);
200 static const char gnu_exp[] =
"GNU C++14 5.0.0 20150123 (experimental)";
201 int major = 0, minor = 0;
204 && major == 5 && minor == 0);
214 #if defined GDB_SELF_TEST 216 (
"producer-parser", selftests::producer::producer_parsing_tests);
void warning(const char *fmt,...)
void _initialize_producer()
static int startswith(const char *string, const char *pattern)
int producer_is_gcc_ge_4(const char *producer)
const char * skip_to_space(const char *chp)
int producer_is_gcc(const char *producer, int *major, int *minor)
bool producer_is_icc(const char *producer, int *major, int *minor)
void register_test(const std::string &name, selftest *test)
#define SELF_CHECK(VALUE)