OSDN Git Service

PR c++/42870
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Feb 2010 22:17:09 +0000 (22:17 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Feb 2010 22:17:09 +0000 (22:17 +0000)
* config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Call
i386_pe_maybe_record_exported_symbol.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156529 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/cygming.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/dllexport3.C [new file with mode: 0644]

index be49d98..c970912 100644 (file)
@@ -1,3 +1,9 @@
+2010-02-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42870
+       * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Call
+       i386_pe_maybe_record_exported_symbol.
+
 2010-02-05  Steve Ellcey  <sje@cup.hp.com>
 
        PR target/42924
index ddec95a..54a61d7 100644 (file)
@@ -361,6 +361,7 @@ do {                                                \
     {                                                                  \
       const char *alias                                                        \
        = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));              \
+      i386_pe_maybe_record_exported_symbol (DECL, alias, 0);           \
       if (TREE_CODE (DECL) == FUNCTION_DECL)                           \
        i386_pe_declare_function_type (STREAM, alias,                   \
                                       TREE_PUBLIC (DECL));             \
index fdb7495..f7a43f5 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42870
+       * g++.dg/ext/dllexport3.C: New.
+
 2010-02-05  Ozkan Sezer  <sezeroz@gmail.com>
 
        * gcc.dg/format/ms-format3.c: New test for specific MS types.
diff --git a/gcc/testsuite/g++.dg/ext/dllexport3.C b/gcc/testsuite/g++.dg/ext/dllexport3.C
new file mode 100644 (file)
index 0000000..a47a5e0
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/42870
+// { dg-do compile { target i?86-*-cygwin *-*-mingw* } }
+// { dg-final { scan-assembler "-export:_ZN2SaD1Ev" } }
+
+#define ATTRIBUTE __attribute__ ((dllexport))
+class ATTRIBUTE Sa {
+ public:
+  Sa()
+    {}
+  ~Sa();
+};
+ATTRIBUTE Sa::~Sa()
+{return;}
+
+bool DllMain(void *a,void*b,int)
+{
+  Sa s;
+  return true;
+}