blob: 3cb4a5bfd54a10962a695b408712c1de0aa75372 [file] [log] [blame]
// RUN: %clang_dfsan %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %run %t foo
// RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %run %t foo
//
// REQUIRES: x86_64-target-arch
#include <stdio.h>
int do_nothing(const char *format, ...) {
return 0;
}
int main(int argc, char **argv) {
int (*fp)(const char *, ...);
if (argc > 1)
fp = do_nothing;
else
fp = printf;
// CHECK: FATAL: DataFlowSanitizer: unsupported indirect call to vararg function printf
fp("hello %s\n", "world");
}