]> granicus.if.org Git - clang/commitdiff
Fix some Window-isms to get these tests to pass on Windows.
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Thu, 29 Oct 2009 00:10:42 +0000 (00:10 +0000)
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Thu, 29 Oct 2009 00:10:42 +0000 (00:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85450 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/format-strings.c
test/Sema/return.c

index 1826c7457e3071c213a7c5cebb699282bff62ca5..797e53c1bd22cdf59ade5429a7add295d6865402 100644 (file)
@@ -8,6 +8,10 @@
 
 char * global_fmt;
 
+#if defined(_WIN32) || defined(_WIN64)
+extern int snprintf(char*, size_t, const char*, ...);
+#endif
+
 void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
 
   char * b;
@@ -83,7 +87,7 @@ void check_wide_string(char* b, ...)
   va_start(ap,b);
 
   printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
-  vasprintf(&b,L"bar %d",ap); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
+  vsprintf(b,L"bar %d",ap); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
 }
 
 void check_asterisk_precision_width(int x) {
index 64def306ebc889a0deb35fe6023897288eed001c..cdd31059b3e7b2ef7301d210aa7e119fa5d13aeb 100644 (file)
@@ -203,7 +203,11 @@ int test30() {
   if (j)
     longjmp(test30_j, 1);
   else
+#if defined(_WIN32) || defined(_WIN64)
+    longjmp(test30_j, 2);
+#else
     _longjmp(test30_j, 1);
+#endif
 }
 
 typedef void test31_t(int status);