1 // RUN: %clang_asan -O2 %s -o %t
2 // RUN: %env_asan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s
3 // RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s
4 // RUN: %run %t 2>&1 | FileCheck %s
8 # define snprintf _snprintf
12 volatile char c
= '0';
14 volatile float f
= 1.239;
15 volatile char s
[] = "34";
16 // Check that printf works fine under Asan.
17 printf("%c %d %.3f %s\n", c
, x
, f
, s
);
18 // CHECK: 0 12 1.239 34
19 // Check that snprintf works fine under Asan.
21 snprintf(buf
, 1000, "qwe");