gdb: rewrite how per language primitive types are managed
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / mixed-lang-stack.c
CommitLineData
6b8c53f2
AB
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
20struct some_struct
21{
22 float a, b;
23};
24
3d11c30a
TV
25/* See https://gcc.gnu.org/onlinedocs/gfortran/\
26 Argument-passing-conventions.html. */
27#if !defined (__GNUC__) || __GNUC__ > 7
28typedef size_t fortran_charlen_t;
29#else
30typedef int fortran_charlen_t;
31#endif
32
6b8c53f2 33extern void mixed_func_1d_ (int *, float *, double *, complex float *,
3d11c30a 34 char *, fortran_charlen_t);
6b8c53f2
AB
35
36void
37mixed_func_1c (int a, float b, double c, complex float d, char *f,
38 struct some_struct *g)
39{
40 printf ("a = %d, b = %f, c = %e, d = (%f + %fi)\n", a, b, c,
41 creal(d), cimag(d));
42
43 char *string = "this is a string from C";
44 mixed_func_1d_ (&a, &b, &c, &d, string, strlen (string));
45}
This page took 0.11524 seconds and 4 git commands to generate.