* gdb.base/langs.exp, gdb.base/langs*: New test.

* gdb.base/Makefile.in: Build it.
	* TODO: Remove item about checking that C names don't get C++
	demangling applied; this test tests it.
This commit is contained in:
Jim Kingdon 1995-02-12 17:55:09 +00:00
parent 21af55c92d
commit c44c67b5ae
7 changed files with 105 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Sun Feb 12 08:11:58 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
* gdb.base/langs.exp, gdb.base/langs*: New test.
* gdb.base/Makefile.in: Build it.
* TODO: Remove item about checking that C names don't get C++
demangling applied; this test tests it.
Thu Feb 9 12:43:56 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
* gdb.stabs/weird.exp: Remove "Haven't examined" comment which

View File

@ -50,6 +50,12 @@ i486-elf.u
i860-elf.u
interrupt.c
interrupt.exp
langs.exp
langs0.c
langs1.c
langs1.f
langs2.c
langs2.cxx
list.exp
list0.c
list0.h

View File

@ -0,0 +1,24 @@
/* This file is actually in C, it is not supposed to simulate something
translated from another language or anything like that. */
int
csub (x)
int x;
{
return x + 1;
}
int
langs0__2do ()
{
return fsub_ () + 2;
}
int
main ()
{
if (langs0__2do () == 5003)
/* Success. */
return 0;
else
return 1;
}

View File

@ -0,0 +1,33 @@
/* langs1.f -- translated by f2c (version of 5 May 1990 1:12:08). */
/* f2c output hacked as follows for GDB testsuite:
1. Change commented out "#" lines to #line directives.
I don't know why this behavior isn't the default for f2c -g.
2. Remove include of f2c.h and put in just a typedef for "integer".
Additional notes:
3. f2c was called as "f2c -g langs1.f".
4. We don't need to use the fortran libraries. */
typedef int integer;
/* Table of constant values */
static integer c__10000 = 10000;
/* I am not sure whether there is a way to have a fortran program without */
/* a MAIN, but it does not really harm us to have one. */
/* Main program */ MAIN__()
{
} /* MAIN__ */
#line 4 "langs1.f"
/* Subroutine */ int fsub_()
{
extern integer cppsub_();
#line 5 "langs1.f"
#line 6 "langs1.f"
return cppsub_(&c__10000);
#line 7 "langs1.f"
} /* fsub_ */

View File

@ -0,0 +1,7 @@
c I am not sure whether there is a way to have a fortran program without
c a MAIN, but it does not really harm us to have one.
end
subroutine fsub
integer*4 cppsub
return (cppsub (10000))
end

View File

@ -0,0 +1,15 @@
/* This is intended to be a vague simulation of cfront output. */
#line 1 "langs2.cxx"
extern int csub ();
int
foo__Fi (x) int x;
{
return csub (x / 2);
}
extern int cppsub_ (int *);
int
cppsub_ (y) int *y;
{
return foo__Fi (*y);
}

View File

@ -0,0 +1,13 @@
extern "C" int csub (int);
int
foo (int x)
{
return csub (x / 2);
}
extern "C" int cppsub_ (int);
int
cppsub_ (int *y)
{
return foo (*y);
}