Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/ext/dllexport4.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 // { dg-do link } | |
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" { *-*-* } } | |
7 | |
8 /* Test that inline functions declared "dllexport" appear in object files, | |
9 even if they are not called - except when -fno-keep-inline-dllexport. | |
10 | |
11 This behavior is required by the ARM C++ ABI: | |
12 | |
13 Exporting a function that can be inlined should force the | |
14 creation and export of an out-of-line copy of it. | |
15 | |
16 and should presumably also apply. | |
17 | |
18 Visual Studio 2005 also honors that rule. */ | |
19 | |
20 __declspec(dllexport) inline void i1() {} | |
21 | |
22 __declspec(dllexport) extern inline void e1() {} | |
23 | |
24 /* It is invalid to declare the function inline after its definition. */ | |
25 #if 0 | |
26 __declspec(dllexport) void i2() {} | |
27 inline void i2(); | |
28 | |
29 __declspec(dllexport) extern void e2() {} | |
30 inline void e2(); | |
31 #endif | |
32 | |
33 __declspec(dllexport) inline void i3() {} | |
34 void i3(); | |
35 | |
36 __declspec(dllexport) inline void e3() {} | |
37 extern void e3(); | |
38 | |
39 __declspec(dllexport) void i4(); | |
40 inline void i4() {}; | |
41 | |
42 __declspec(dllexport) extern void e4(); | |
43 inline void e4() {}; | |
44 | |
45 __declspec(dllexport) inline void i5(); | |
46 void i5() {}; | |
47 | |
48 __declspec(dllexport) inline void e5(); | |
49 extern void e5() {}; | |
50 | |
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(); |