1*7c3d14c8STreehugger Robot // RUN: %clang_tsan -O2 %s -o %t 2*7c3d14c8STreehugger Robot // RUN: %env_tsan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s 3*7c3d14c8STreehugger Robot // RUN: %env_tsan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s 4*7c3d14c8STreehugger Robot // RUN: %run %t 2>&1 | FileCheck %s 5*7c3d14c8STreehugger Robot 6*7c3d14c8STreehugger Robot #include <stdio.h> main()7*7c3d14c8STreehugger Robotint main() { 8*7c3d14c8STreehugger Robot volatile char c = '0'; 9*7c3d14c8STreehugger Robot volatile int x = 12; 10*7c3d14c8STreehugger Robot volatile float f = 1.239; 11*7c3d14c8STreehugger Robot volatile char s[] = "34"; 12*7c3d14c8STreehugger Robot printf("%c %d %.3f %s\n", c, x, f, s); 13*7c3d14c8STreehugger Robot return 0; 14*7c3d14c8STreehugger Robot // Check that printf works fine under Tsan. 15*7c3d14c8STreehugger Robot // CHECK: 0 12 1.239 34 16*7c3d14c8STreehugger Robot } 17