format-strings-utf8.m
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// REQUIRES: system-darwin
// RUN: rm -f %t.log
// RUN: env RC_DEBUG_OPTIONS=1 \
// RUN: CC_LOG_DIAGNOSTICS=1 CC_LOG_DIAGNOSTICS_FILE=%t.log \
// RUN: %clang -target x86_64-apple-darwin -fsyntax-only %s
// RUN: FileCheck %s < %t.log
#include <stdarg.h>
int printf(const char *restrict, ...);
int scanf(const char * restrict, ...);
@class NSString, Protocol;
extern void NSLog(NSString *format, ...);
void testInvalidNoPrintable(int *a) {
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\xe2'</string>
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\xe2'</string>
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\u25b9'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\U00010348'</string>
// CHECK: <string>invalid conversion specifier '\xe2'</string>
printf("%\u25B9");
printf("%\xE2\x96\xB9");
printf("%\U00010348");
printf("%\xF0\x90\x8D\x88");
printf("%\xe2");
NSLog(@"%\u25B9");
NSLog(@"%\xE2\x96\xB9");
NSLog(@"%\U00010348");
NSLog(@"%\xF0\x90\x8D\x88");
NSLog(@"%\xe2");
scanf("%\u25B9", a);
scanf("%\xE2\x96\xB9", a);
scanf("%\U00010348", a);
scanf("%\xF0\x90\x8D\x88", a);
scanf("%\xe2", a);
}