#include <stdarg.h>
#include <stddef.h>
#define __need_wint_t
#include <stddef.h>
int printf(const char *restrict, ...);
@interface NSString
@end
void test_os_log_format(const char *pc, int i, void *p, void *buf) {
__builtin_os_log_format(buf, "");
__builtin_os_log_format(buf, "%d"); __builtin_os_log_format(buf, "%d", i);
__builtin_os_log_format(buf, "%P", p); __builtin_os_log_format(buf, "%.10P", p);
__builtin_os_log_format(buf, "%.*P", p); __builtin_os_log_format(buf, "%.*P", i, p);
__builtin_os_log_format(buf, "%.*P", i, i); __builtin_os_log_format(buf, "%n"); __builtin_os_log_format(buf, pc);
printf("%{private}s", pc); __builtin_os_log_format(buf, "%{private}s", pc);
__builtin_os_log_format_buffer_size("no-args");
__builtin_os_log_format(buf, "%s", "hi");
wchar_t wc = 'a';
__builtin_os_log_format(buf, "%C", wc);
printf("%C", wc);
wchar_t wcs[] = {'a', 0};
__builtin_os_log_format(buf, "%S", wcs);
printf("%S", wcs);
struct { char data[0x100]; } toobig;
__builtin_os_log_format(buf, "%s", toobig);
__builtin_os_log_format(buf, "%{mask.xyz}s", "abc");
__builtin_os_log_format(buf, "%{mask.}s", "abc"); __builtin_os_log_format(buf, "%{mask.abcdefghi}s", "abc"); }
void test_objc(const char *pc, int i, void *p, void *buf, NSString *nss) {
__builtin_os_log_format(buf, @"");
__builtin_os_log_format(buf, @"%d"); __builtin_os_log_format(buf, @"%d", i);
__builtin_os_log_format(buf, @"%P", p); __builtin_os_log_format(buf, @"%.10P", p);
__builtin_os_log_format(buf, @"%.*P", p); __builtin_os_log_format(buf, @"%.*P", i, p);
__builtin_os_log_format(buf, @"%.*P", i, i);
__builtin_os_log_format(buf, @"%{private}s", pc);
__builtin_os_log_format(buf, @"%@", nss);
}
void MyOSLog(const char *format, ...) __attribute__((format(os_log, 1, 2)));
void test_attribute(void *p) {
MyOSLog("%s\n", "Hello");
MyOSLog("%d"); MyOSLog("%P", p); }