dll-1.c: Remove thumb target.

* gcc.dg/dll-1.c: Remove thumb target. Change exp to _exp.
	* gcc.dg/dll-2.c: Enable for cygwin and mingw. Remove
	thumb target,
	* gcc.dg/dll-3.c: Likewise. Adjust scan-assembler
	to accept newer _imp__	prefix and additional
	newline in .drectve section.
	* gcc.dg/dll-4.c: Likewise.
	* gcc.dg/dll-5.c: New file to test -mnop-fun-dllimport
	switch.

From-SVN: r64337
This commit is contained in:
Danny Smith 2003-03-13 22:21:21 +00:00 committed by Danny Smith
parent 0171b21c32
commit 67e4f07820
6 changed files with 48 additions and 10 deletions

View file

@ -1,3 +1,15 @@
2003-03-13 Danny Smith <dannysmith@users.sourceforge.net>
* gcc.dg/dll-1.c: Remove thumb target. Change exp to _exp.
* gcc.dg/dll-2.c: Enable for cygwin and mingw. Remove
thumb target,
* gcc.dg/dll-3.c: Likewise. Adjust scan-assembler
to accept newer _imp__ prefix and additional
newline in .drectve section.
* gcc.dg/dll-4.c: Likewise.
* gcc.dg/dll-5.c: New file to test -mnop-fun-dllimport
switch.
2003-03-13 Mark Mitchell <mark@codesourcery.com>
* g++.dg/parse/namespace9.C: New test.

View file

@ -1,10 +1,10 @@
/* { dg-do compile { target arm*-*-pe* } } */
/* { dg-do compile { target thumb*-*-pe* } } */
/* { dg-options -mno-nop-fun-dllimport } */
__declspec (dllimport) void imp ();
__declspec (dllexport) void exp () { imp (); }
__declspec (dllexport) void _exp () { imp (); }
/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\[^\n\]*-export:_exp.*__imp_imp" } } */
/* { dg-final { scan-assembler-not "__imp__exp" } } */
/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\[^\n\]*-export:exp.*__imp_imp" } } */
/* { dg-final { scan-assembler-not "__imp_exp" } } */

View file

@ -9,7 +9,8 @@
and functions. In C++, it only works for functions. */
/* { dg-do compile { target arm*-*-pe* } } */
/* { dg-do compile { target thumb*-*-pe* } } */
/* { dg-do compile { target i?86-pc-cygwin } } */
/* { dg-do compile { target i?86-pc-mingw* } } */
__declspec (dllimport) int foo1 ();
__declspec (dllexport) int foo1 ();

View file

@ -1,7 +1,8 @@
/* Ensure dllexport overrides dllimport. */
/* { dg-do compile { target arm*-*-pe* } } */
/* { dg-do compile { target thumb*-*-pe* } } */
/* { dg-do compile { target i?86-pc-cygwin } } */
/* { dg-do compile { target i?86-pc-mingw* } } */
__declspec (dllimport) int foo1 ();
__declspec (dllexport) int foo1 ();
@ -12,5 +13,6 @@ __declspec (dllimport) int foo2 ();
__declspec (dllexport) int foo1 () { return foo2 (); }
__declspec (dllexport) int foo2 () { return foo1 (); }
/* { dg-final { scan-assembler "\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo1.*\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo2" } } */
/* { dg-final { scan-assembler-not "(__imp_foo1|__imp_foo2)" } } */
/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n.*-export:foo2" } } */
/* { dg-final { scan-assembler "-export:foo1" } } */
/* { dg-final { scan-assembler-not "(__imp_foo1|_imp__foo1|__imp_foo2|_imp__foo2)" } } */

View file

@ -1,5 +1,6 @@
/* { dg-do compile { target arm*-*-pe* } } */
/* { dg-do compile { target thumb*-*-pe* } } */
/* { dg-do compile { target i?86-pc-cygwin } } */
/* { dg-do compile { target i?86-pc-mingw* } } */
__declspec (dllimport) int foo1;
int foo1;
@ -11,4 +12,4 @@ int f () { return foo1 + foo2; }
/* FIXME: We should scan the output of nm for this case. */
/* { dg-final { scan-assembler "(foo2:.*\.comm\[ \t_\]*foo1)" } } */
/* { dg-final { scan-assembler-not "__imp_" } } */
/* { dg-final { scan-assembler-not "(__imp_|_imp__)" } } */

View file

@ -0,0 +1,22 @@
/* { dg-do compile { target i?86-pc-cygwin } } */
/* { dg-do compile { target i?86-pc-mingw* } } */
/* { dg-do compile { target arm*-*-pe* } } */
/* { dg-options -mnop-fun-dllimport } */
/* The dllimport attribute should be ignored for functions. */
__declspec (dllimport) void dllimpfn ();
/* The dllimport attribute should not be ignored for variables. */
__declspec (dllimport) int dllimpvar;
/* The dllexport attribute should not be ignored. */
__declspec (dllexport) void dllexp ()
{
dllimpfn ();
dllimpvar = 0;
}
/* { dg-final { scan-assembler-not "(__imp_dllimpfn|_imp__dllimpfn)" } } */
/* { dg-final { scan-assembler "(__imp_dllimpvar|_imp__dllimpvar)" } } */
/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\.*-export:dllexp" } } */