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