r212417 - The MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF.

Aaron Ballman aaron at aaronballman.com
Sun Jul 6 13:04:11 PDT 2014


Author: aaronballman
Date: Sun Jul  6 15:04:10 2014
New Revision: 212417

URL: http://llvm.org/viewvc/llvm-project?rev=212417&view=rev
Log:
The MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF.

Modified:
    cfe/trunk/test/Parser/MicrosoftExtensions.c
    cfe/trunk/test/Parser/MicrosoftExtensions.cpp

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=212417&r1=212416&r2=212417&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Sun Jul  6 15:04:10 2014
@@ -1,85 +1,58 @@
-// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions  -Wno-missing-declarations -x objective-c++ %s
-__stdcall int func0();
-int __stdcall func();
-typedef int (__cdecl *tptr)();
-void (*__fastcall fastpfunc)();
-struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) __declspec(novtable) IUnknown {}; /* expected-warning{{__declspec attribute 'novtable' is not supported}} */
-extern __declspec(dllimport) void __stdcall VarR4FromDec();
+// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -Wno-missing-declarations -verify -fms-extensions  %s
+__stdcall int func0(void);
+int __stdcall func(void);
+typedef int (__cdecl *tptr)(void);
+void (*__fastcall fastpfunc)(void);
+extern __declspec(dllimport) void __stdcall VarR4FromDec(void);
 __declspec(deprecated) __declspec(deprecated) char * __cdecl ltoa( long _Val, char * _DstBuf, int _Radix);
-__declspec(safebuffers) __declspec(noalias) __declspec(restrict) void * __cdecl xxx( void * _Memory ); /* expected-warning{{__declspec attribute 'safebuffers' is not supported}} expected-warning{{__declspec attribute 'noalias' is not supported}} expected-warning{{__declspec attribute 'restrict' is not supported}} */
+__declspec(safebuffers) __declspec(noalias) __declspec(restrict) void * __cdecl xxx(void *_Memory); /* expected-warning{{__declspec attribute 'safebuffers' is not supported}} expected-warning{{__declspec attribute 'noalias' is not supported}} expected-warning{{__declspec attribute 'restrict' is not supported}} */
 typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR;
 
-void * __ptr64 PtrToPtr64(const void *p)
-{
+void * __ptr64 PtrToPtr64(const void *p) {
   return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
 }
-void * __ptr32 PtrToPtr32(const void *p)
-{
+
+void * __ptr32 PtrToPtr32(const void *p) {
   return((void * __ptr32) (unsigned __int32) (ULONG_PTR)p );
 }
 
-// Both inline and __forceinline is OK.
-inline void __forceinline pr8264() {
-}
-__forceinline void inline pr8264_1() {
-}
-void inline __forceinline pr8264_2() {
-}
-void __forceinline inline pr8264_3() {
-}
-// But duplicate __forceinline causes warning.
-void __forceinline __forceinline pr8264_4() {  // expected-warning{{duplicate '__forceinline' declaration specifier}}
+/* Both inline and __forceinline is OK. */
+inline void __forceinline pr8264(void) {}
+__forceinline void inline pr8264_1(void) {}
+void inline __forceinline pr8264_2(void) {}
+void __forceinline inline pr8264_3(void) {}
+/* But duplicate __forceinline causes warning. */
+void __forceinline __forceinline pr8264_4(void) {  /* expected-warning{{duplicate '__forceinline' declaration specifier}} */
 }
 
-_inline int foo99() { return 99; }
+_inline int foo99(void) { return 99; }
 
-void test_ms_alignof_alias() {
+void test_ms_alignof_alias(void) {
   unsigned int s = _alignof(int);
   s = __builtin_alignof(int);
 }
 
-void *_alloca(int);
-
-void foo() {
-  __declspec(align(16)) int *buffer = (int *)_alloca(9);
-}
-
-typedef bool (__stdcall __stdcall *blarg)(int);
-
-void local_callconv()
-{
-  bool (__stdcall *p)(int);
-}
-
-// Charify extension.
+/* Charify extension. */
 #define FOO(x) #@x
 char x = FOO(a);
 
 typedef enum E { e1 };
 
+enum __declspec(deprecated) E2 { i, j, k }; /* expected-note {{'E2' has been explicitly marked deprecated here}} */
+__declspec(deprecated) enum E3 { a, b, c } e; /* expected-note {{'e' has been explicitly marked deprecated here}} */
 
-enum __declspec(deprecated) E2 { i, j, k }; // expected-note {{'E2' has been explicitly marked deprecated here}}
-__declspec(deprecated) enum E3 { a, b, c } e; // expected-note {{'e' has been explicitly marked deprecated here}}
-
-void deprecated_enum_test(void)
-{
-  // Test to make sure the deprecated warning follows the right thing
-  enum E2 e1;  // expected-warning {{'E2' is deprecated}}
-  enum E3 e2; // No warning expected, the deprecation follows the variable
-  enum E3 e3 = e;  // expected-warning {{'e' is deprecated}}
+void deprecated_enum_test(void) {
+  /* Test to make sure the deprecated warning follows the right thing */
+  enum E2 e1;  /* expected-warning {{'E2' is deprecated}} */
+  enum E3 e2; /* No warning expected, the deprecation follows the variable */
+  enum E3 e3 = e;  /* expected-warning {{'e' is deprecated}} */
 }
 
 /* Microsoft attribute tests */
-[repeatable][source_annotation_attribute( Parameter|ReturnValue )]
-struct SA_Post{ SA_Post(); int attr; };
-
 [returnvalue:SA_Post( attr=1)]
 int foo1([SA_Post(attr=1)] void *param);
 
-
-
-void ms_intrinsics(int a)
-{
+void ms_intrinsics(int a) {
   __noop();
   __assume(a);
   __debugbreak();
@@ -102,17 +75,6 @@ struct __declspec(align(8) deprecated) S
 struct __declspec(deprecated frobble "testing") S5 {};  /* expected-warning {{__declspec attribute 'frobble' is not supported}} expected-warning {{__declspec attribute '"testing"' is not supported}} */
 struct __declspec(unknown(12) deprecated) S6 {};	/* expected-warning {{__declspec attribute 'unknown' is not supported}}*/
 
-struct S7 {
-	int foo() { return 12; }
-	__declspec(property(get=foo) deprecated) int t; // expected-note {{'t' has been explicitly marked deprecated here}}
-};
-
-/* Technically, this is legal (though it does nothing) */
-__declspec() void quux( void ) {
-  struct S7 s;
-  int i = s.t;	/* expected-warning {{'t' is deprecated}} */
-}
-
 int * __sptr psp;
 int * __uptr pup;
 /* Either ordering is acceptable */

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=212417&r1=212416&r2=212417&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Sun Jul  6 15:04:10 2014
@@ -332,3 +332,28 @@ void TestProperty() {
 
 //expected-warning at +1 {{C++ operator 'and' (aka '&&') used as a macro name}}
 #define and foo
+
+struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) __declspec(novtable) IUnknown {}; // expected-warning{{__declspec attribute 'novtable' is not supported}}
+
+typedef bool (__stdcall __stdcall *blarg)(int);
+
+void local_callconv() {
+  bool (__stdcall *p)(int);
+}
+
+struct S7 {
+	int foo() { return 12; }
+	__declspec(property(get=foo) deprecated) int t; // expected-note {{'t' has been explicitly marked deprecated here}}
+};
+
+// Technically, this is legal (though it does nothing)
+__declspec() void quux( void ) {
+  struct S7 s;
+  int i = s.t;	// expected-warning {{'t' is deprecated}}
+}
+
+void *_alloca(int);
+
+void foo(void) {
+  __declspec(align(16)) int *buffer = (int *)_alloca(9);
+}





More information about the cfe-commits mailing list