diff options
| author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-06-30 01:48:58 +0000 |
|---|---|---|
| committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-06-30 01:48:58 +0000 |
| commit | 14b1755091055da00f1fb642134c8f73bcc80dc2 (patch) | |
| tree | c3da39afeac40912cb398d235426faf5c2c75a30 | |
| parent | 0f1adac24272611fa331e7233b213a8b99a5d4d0 (diff) | |
| download | ppe42-gcc-14b1755091055da00f1fb642134c8f73bcc80dc2.tar.gz ppe42-gcc-14b1755091055da00f1fb642134c8f73bcc80dc2.zip | |
Test DLL attribute support.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27843 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/dll.c | 21 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/dll.x | 20 |
3 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog index 60f2943ab00..71e83c6e78d 100644 --- a/gcc/testsuite/gcc.c-torture/ChangeLog +++ b/gcc/testsuite/gcc.c-torture/ChangeLog @@ -1,3 +1,10 @@ +1999-06-23 Nick Clifton <nickc@cygnus.com> + + * compile/dll.c: New test case. Check that dll attributes + compile. + * compile/dll.x: Only support the dll.c test on ports that + use the COFF/PE file format. + 1999-05-25 Nick Clifton <nickc@cygnus.com> * execute/bf-sign-2.c: Explicitly declare signed bitfields as diff --git a/gcc/testsuite/gcc.c-torture/compile/dll.c b/gcc/testsuite/gcc.c-torture/compile/dll.c new file mode 100644 index 00000000000..bf0d1544ad0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dll.c @@ -0,0 +1,21 @@ +__declspec (dllimport) int foo; +extern int (* import) (void) __attribute__((dllimport)); +int func2 (void) __attribute__((dllexport)); + +__declspec(dllexport) int +func1 (int a) +{ + return a + foo; +} + +static int +internal (void) +{ + return 77; +} + +int +func2 (void) +{ + return import (); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dll.x b/gcc/testsuite/gcc.c-torture/compile/dll.x new file mode 100644 index 00000000000..63a1e180e2c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dll.x @@ -0,0 +1,20 @@ +# This test examines the attribute support for DLLs. +# Only COFF/PE formats support DLLs, (plus, as a special case +# the mcore-elf toolchain), so the code here tries to determine +# the file format and decide whether the test should be marked +# as unsupported. + +set torture_eval_before_compile { + + if ![istarget "mcore-*-elf"] { + + set objformat [gcc_target_object_format] + + if { $objformat != "pe" } { + unsupported "dll.c" + return 1 + } + } +} + +return 0 |

