dll-1.c: Remove thumb target.
authorDanny Smith <dannysmith@users.sourceforge.net>
Thu, 13 Mar 2003 22:21:21 +0000 (22:21 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Thu, 13 Mar 2003 22:21:21 +0000 (22:21 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/dll-1.c
gcc/testsuite/gcc.dg/dll-2.c
gcc/testsuite/gcc.dg/dll-3.c
gcc/testsuite/gcc.dg/dll-4.c
gcc/testsuite/gcc.dg/dll-5.c [new file with mode: 0644]

index 1cf08340a1416a5ccfe3910a7c0606ec0f501cde..40e66e03b0082b73988160b9a4d58b8863f51da8 100644 (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.
index 4ae1a0e1797724032a24d9a62088c4db3557985f..f823523b2700f8fc08572c53865de577f9ca0649 100644 (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" } } */
index bf9170799659e5559e3c32c283f9ddf90f42d55f..45456ce8330249517791c382a6e6305c5e07a24f 100644 (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 ();
index 0be1f9730252d6c57a5c7980ffcc919dd5563f7e..2d5517eace62aa49126b584de6916c0b56a8f6d1 100644 (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)" } } */
index fec08fcbb604d09ecdaf42114f69cc8cd4262281..45ed7a11007016cc3f7bb29c77e405577d77a30c 100644 (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__)" } } */
diff --git a/gcc/testsuite/gcc.dg/dll-5.c b/gcc/testsuite/gcc.dg/dll-5.c
new file mode 100644 (file)
index 0000000..df7e3e3
--- /dev/null
@@ -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" } } */