Bruno Cardoso Lopes | 03e18d4 | 2016-03-29 21:30:58 +0000 | [diff] [blame^] | 1 | // REQUIRES: system-darwin |
Bruno Cardoso Lopes | 10b1c80 | 2016-03-29 20:47:09 +0000 | [diff] [blame] | 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 |
Bruno Cardoso Lopes | dc195d0 | 2016-03-29 18:38:44 +0000 | [diff] [blame] | 7 | |
| 8 | #include <stdarg.h> |
| 9 | int printf(const char *restrict, ...); |
| 10 | int scanf(const char * restrict, ...); |
| 11 | @class NSString, Protocol; |
| 12 | extern void NSLog(NSString *format, ...); |
| 13 | |
| 14 | void testInvalidNoPrintable(int *a) { |
Bruno Cardoso Lopes | 10b1c80 | 2016-03-29 20:47:09 +0000 | [diff] [blame] | 15 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 16 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 17 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 18 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 19 | // CHECK: <string>invalid conversion specifier '\xe2'</string> |
| 20 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 21 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 22 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 23 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 24 | // CHECK: <string>invalid conversion specifier '\xe2'</string> |
| 25 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 26 | // CHECK: <string>invalid conversion specifier '\u25b9'</string> |
| 27 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 28 | // CHECK: <string>invalid conversion specifier '\U00010348'</string> |
| 29 | // CHECK: <string>invalid conversion specifier '\xe2'</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); |
Bruno Cardoso Lopes | dc195d0 | 2016-03-29 18:38:44 +0000 | [diff] [blame] | 45 | } |