2 // { dg-require-dll "" }
3 // { dg-additional-sources "dllexport4a.cc" }
4 // { dg-options "-O2 -fno-keep-inline-dllexport" }
5 // { dg-prune-output .*undefined.* }
6 // { dg-xfail-if "link failure expected" { *-*-* } }
8 /* Test that inline functions declared "dllexport" appear in object files,
9 even if they are not called - except when -fno-keep-inline-dllexport.
11 This behavior is required by the ARM C++ ABI:
13 Exporting a function that can be inlined should force the
14 creation and export of an out-of-line copy of it.
16 and should presumably also apply.
18 Visual Studio 2005 also honors that rule. */
20 __declspec(dllexport) inline void i1() {}
22 __declspec(dllexport) extern inline void e1() {}
24 /* It is invalid to declare the function inline after its definition. */
26 __declspec(dllexport) void i2() {}
29 __declspec(dllexport) extern void e2() {}
33 __declspec(dllexport) inline void i3() {}
36 __declspec(dllexport) inline void e3() {}
39 __declspec(dllexport) void i4();
42 __declspec(dllexport) extern void e4();
45 __declspec(dllexport) inline void i5();
48 __declspec(dllexport) inline void e5();
51 /* Make sure that just declaring the function -- without defining it
52 -- does not cause errors. */
53 __declspec(dllexport) inline void i6();
54 __declspec(dllexport) extern inline void e6();