blob: f51e39c718990acdb03e6558e8fd05cbe15ed09c [file] [log] [blame]
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -07001// RUN: %clang_dfsan %s -o %t
Stephen Hines6d186232014-11-26 17:56:19 -08002// RUN: not %run %t 2>&1 | FileCheck %s
3// RUN: %run %t foo
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -07004// RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t
Stephen Hines6d186232014-11-26 17:56:19 -08005// RUN: not %run %t 2>&1 | FileCheck %s
6// RUN: %run %t foo
7
8#include <stdio.h>
9
10int do_nothing(const char *format, ...) {
11 return 0;
12}
13
14int 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}