Home | History | Annotate | Download | only in dfsan
      1 // RUN: %clang_dfsan %s -o %t
      2 // RUN: not %run %t 2>&1 | FileCheck %s
      3 // RUN: %run %t foo
      4 // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t
      5 // RUN: not %run %t 2>&1 | FileCheck %s
      6 // RUN: %run %t foo
      7 
      8 #include <stdio.h>
      9 
     10 int do_nothing(const char *format, ...) {
     11   return 0;
     12 }
     13 
     14 int main(int argc, char **argv) {
     15   int (*fp)(const char *, ...);
     16 
     17   if (argc > 1)
     18     fp = do_nothing;
     19   else
     20     fp = printf;
     21 
     22   // CHECK: FATAL: DataFlowSanitizer: unsupported indirect call to vararg function printf
     23   fp("hello %s\n", "world");
     24 }
     25