summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/dllimport8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/dllimport8.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/dllimport8.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/dllimport8.C b/gcc/testsuite/g++.dg/ext/dllimport8.C
new file mode 100644
index 000000000..af605a368
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllimport8.C
@@ -0,0 +1,29 @@
+// PR c++/8378
+// Ignore dllimport of static members if marked inlined.
+// or if definition follows declaration in dllimported class.
+
+// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } }
+// { dg-options { -Wall -W } }
+
+struct __attribute__((dllimport)) Foo
+{
+ static int static_int;
+ static void static_func1();
+ static void static_func2();
+ };
+
+void Foo::static_func1() // { dg-warning "redeclared without dllimport" }
+{
+}
+
+inline void Foo::static_func2()
+{
+}
+
+void testfoo()
+{
+ Foo::static_func1();
+ Foo::static_func2();
+}
+
+// { dg-final { scan-assembler-not "__imp_" } }