Revert "[gdb/testsuite] Clean standard_output_file dir in gdb_init"
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / mixed-lang-stack.c
blob722cfa3e35857dbe412e48fe3c969d210150c5e7
1 /* Copyright 2020-2023 Free Software Foundation, Inc.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
16 #include <stdio.h>
17 #include <complex.h>
18 #include <string.h>
20 struct some_struct
22 float a, b;
25 /* See https://gcc.gnu.org/onlinedocs/gfortran/\
26 Argument-passing-conventions.html. */
27 #if !defined (__GNUC__) || __GNUC__ > 7
28 typedef size_t fortran_charlen_t;
29 #else
30 typedef int fortran_charlen_t;
31 #endif
33 extern void mixed_func_1d_ (int *, float *, double *, complex float *,
34 char *, fortran_charlen_t);
36 void
37 mixed_func_1c (int a, float b, double c, complex float d, char *f,
38 struct some_struct *g)
40 printf ("a = %d, b = %f, c = %e, d = (%f + %fi)\n", a, b, c,
41 creal(d), cimag(d));
43 char *string = "this is a string from C";
44 mixed_func_1d_ (&a, &b, &c, &d, string, strlen (string));