r264765 - [Sema] Attempt to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 29 11:38:45 PDT 2016
Author: bruno
Date: Tue Mar 29 13:38:44 2016
New Revision: 264765
URL: http://llvm.org/viewvc/llvm-project?rev=264765&view=rev
Log:
[Sema] Attempt to fix tests for utf-8 invalid format string specifiers
Followup from r264752.
Attempt to appease buildbots:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2882
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2619
Added:
cfe/trunk/test/SemaObjC/format-strings-utf8.m
Modified:
cfe/trunk/test/Sema/format-strings-scanf.c
cfe/trunk/test/Sema/format-strings.c
cfe/trunk/test/SemaObjC/format-strings-objc.m
Modified: cfe/trunk/test/Sema/format-strings-scanf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings-scanf.c?rev=264765&r1=264764&r2=264765&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings-scanf.c (original)
+++ cfe/trunk/test/Sema/format-strings-scanf.c Tue Mar 29 13:38:44 2016
@@ -183,11 +183,3 @@ void check_conditional_literal(char *s,
scanf(i ? "%d" : "%d", i, s); // expected-warning{{data argument not used}}
scanf(i ? "%s" : "%d", s); // expected-warning{{format specifies type 'int *'}}
}
-
-void testInvalidNoPrintable(int *a) {
- scanf("%\u25B9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
- scanf("%\xE2\x96\xB9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
- scanf("%\U00010348", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
- scanf("%\xF0\x90\x8D\x88", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
- scanf("%\xe2", a); // expected-warning {{invalid conversion specifier '\xe2'}}
-}
Modified: cfe/trunk/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=264765&r1=264764&r2=264765&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings.c (original)
+++ cfe/trunk/test/Sema/format-strings.c Tue Mar 29 13:38:44 2016
@@ -642,14 +642,6 @@ void test_qualifiers(volatile int *vip,
printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has type 'cip_t' (aka 'const int *')}}
}
-void testInvalidNoPrintable() {
- printf("%\u25B9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
- printf("%\xE2\x96\xB9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
- printf("%\U00010348"); // expected-warning {{invalid conversion specifier '\U00010348'}}
- printf("%\xF0\x90\x8D\x88"); // expected-warning {{invalid conversion specifier '\U00010348'}}
- printf("%\xe2"); // expected-warning {{invalid conversion specifier '\xe2'}}
-}
-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#pragma GCC diagnostic warning "-Wformat-security"
// <rdar://problem/14178260>
Modified: cfe/trunk/test/SemaObjC/format-strings-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/format-strings-objc.m?rev=264765&r1=264764&r2=264765&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/format-strings-objc.m (original)
+++ cfe/trunk/test/SemaObjC/format-strings-objc.m Tue Mar 29 13:38:44 2016
@@ -264,12 +264,3 @@ void testObjCModifierFlags() {
NSLog(@"%2$[tt]@ %1$[tt]@", @"Foo", @"Bar"); // no-warning
NSLog(@"%2$[tt]@ %1$[tt]s", @"Foo", @"Bar"); // expected-warning {{object format flags cannot be used with 's' conversion specifier}}
}
-
-// Test Objective-C invalid no printable specifiers
-void testObjcInvalidNoPrintable(int *a) {
- NSLog(@"%\u25B9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
- NSLog(@"%\xE2\x96\xB9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
- NSLog(@"%\U00010348"); // expected-warning {{invalid conversion specifier '\U00010348'}}
- NSLog(@"%\xF0\x90\x8D\x88"); // expected-warning {{invalid conversion specifier '\U00010348'}}
- NSLog(@"%\xe2"); // expected-warning {{input conversion stopped}} expected-warning {{invalid conversion specifier '\xe2'}}
-}
Added: cfe/trunk/test/SemaObjC/format-strings-utf8.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/format-strings-utf8.m?rev=264765&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/format-strings-utf8.m (added)
+++ cfe/trunk/test/SemaObjC/format-strings-utf8.m Tue Mar 29 13:38:44 2016
@@ -0,0 +1,27 @@
+// REQUIRES: shell
+// RUN: env -i LC_ALL=C \
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -Wformat-nonliteral -fsyntax-only -verify -Wno-objc-root-class %s
+
+#include <stdarg.h>
+int printf(const char *restrict, ...);
+int scanf(const char * restrict, ...);
+ at class NSString, Protocol;
+extern void NSLog(NSString *format, ...);
+
+void testInvalidNoPrintable(int *a) {
+ printf("%\u25B9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ printf("%\xE2\x96\xB9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ printf("%\U00010348"); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ printf("%\xF0\x90\x8D\x88"); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ printf("%\xe2"); // expected-warning {{invalid conversion specifier '\xe2'}}
+ NSLog(@"%\u25B9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ NSLog(@"%\xE2\x96\xB9"); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ NSLog(@"%\U00010348"); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ NSLog(@"%\xF0\x90\x8D\x88"); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ NSLog(@"%\xe2"); // expected-warning {{input conversion stopped}} expected-warning {{invalid conversion specifier '\xe2'}}
+ scanf("%\u25B9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ scanf("%\xE2\x96\xB9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ scanf("%\U00010348", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ scanf("%\xF0\x90\x8D\x88", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ scanf("%\xe2", a); // expected-warning {{invalid conversion specifier '\xe2'}}
+}
More information about the cfe-commits
mailing list