From 4dc3035a5f2d96a801460695ce8d1695ef5b2292 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 17 Mar 2008 15:26:05 +0000 Subject: [PATCH] improve tests, new ms types test [r18962] --- parsetest/MS/declspec.c | 11 +++++++++-- parsetest/MS/mstypes.c | 12 ++++++++++++ parsetest/noconst.c | 5 +++-- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 parsetest/MS/mstypes.c diff --git a/parsetest/MS/declspec.c b/parsetest/MS/declspec.c index 9bf1173..b702a53 100644 --- a/parsetest/MS/declspec.c +++ b/parsetest/MS/declspec.c @@ -1,11 +1,18 @@ #include "declspec.h" +int test2(void) { + return 0; +} + int __declspec(align(4)) x; int __declspec(dllimport) y; int __declspec(dllexport, align(4)) z; -int __declspec(noinline, naked, deprecated("Mist"))func(void); +int __declspec(noinline, naked, deprecated("Mist"))func(void) +{ + return 42; +} struct x { int __declspec(property(get=get_a, put=put_a)) a; @@ -21,7 +28,7 @@ void test3(void) { __declspec(deprecated) int (*ptr)(void) = ****test2; -int test4(void) { +int main(void) { int x = ptr(); printf("%I64d\n", x); return x; diff --git a/parsetest/MS/mstypes.c b/parsetest/MS/mstypes.c new file mode 100644 index 0000000..8200a67 --- /dev/null +++ b/parsetest/MS/mstypes.c @@ -0,0 +1,12 @@ +int printf(const char *str, ...); + +__int8 blup = 42; +signed __int8 blup2 = 43; +unsigned __int8 blup3 = 44; +__int64 blup4 = 0xfffffff00000045; +unsigned __int64 blup5 = 0xffffffff00000045; + +int main(void) +{ + printf("%d %d %u %I64d %I64u\n", blup, blup2, blup3, blup4, blup5); +} diff --git a/parsetest/noconst.c b/parsetest/noconst.c index f685ffd..ef8f0b0 100644 --- a/parsetest/noconst.c +++ b/parsetest/noconst.c @@ -1,7 +1,8 @@ int func(void) { return 0; } -int (*ptr)(void) = **func; +int (*ptr)(void) = func; +int (*ptr2)(void) = *&*&func; int main(void) { - return ptr(); + return ptr2() + ptr(); } -- 2.20.1