From 5ae950cecb8162f7c52680125902754aeb400bc7 Mon Sep 17 00:00:00 2001 From: bing Date: Sat, 30 Sep 2023 20:35:34 +0800 Subject: [PATCH] add no declspec tests --- test/cases/no declspec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/cases/no declspec.c b/test/cases/no declspec.c index 0b4c36d0..720a2c66 100644 --- a/test/cases/no declspec.c +++ b/test/cases/no declspec.c @@ -1,4 +1,12 @@ __declspec(align(4)) int foo; +#if __has_declspec_attribute(noreturn) +#error "__has_declspec_attribute macro should not work without -fdeclspec" +#endif + +#if __has_declspec_attribute(x) +#error "__has_declspec_attribute macro should not work without -fdeclspec" +#endif + #define EXPECTED_ERRORS \ "no declspec.c:1:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes" \