gdb/testsuite/fortran: Add mixed language stack test
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / mixed-lang-stack.c
1 /* Copyright 2020 Free Software Foundation, Inc.
2
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 2 of the License, or
6 (at your option) any later version.
7
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.
12
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/>. */
15
16 #include <stdio.h>
17 #include <complex.h>
18 #include <string.h>
19
20 struct some_struct
21 {
22 float a, b;
23 };
24
25 extern void mixed_func_1d_ (int *, float *, double *, complex float *,
26 char *, size_t);
27
28 void
29 mixed_func_1c (int a, float b, double c, complex float d, char *f,
30 struct some_struct *g)
31 {
32 printf ("a = %d, b = %f, c = %e, d = (%f + %fi)\n", a, b, c,
33 creal(d), cimag(d));
34
35 char *string = "this is a string from C";
36 mixed_func_1d_ (&a, &b, &c, &d, string, strlen (string));
37 }
This page took 0.030443 seconds and 4 git commands to generate.