1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.security.taint,debug.TaintTest,unix.Malloc %s -verify -analyzer-output=sarif -o - | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif -
2 #include "../Inputs/system-header-simulator.h"
3 #include "../Inputs/system-header-simulator-for-malloc.h"
6 int atoi(const char *nptr
);
11 int d
= atoi(s
); // expected-warning {{tainted}}
16 fp(12); // expected-warning {{Called function pointer is an uninitialized pointer value}}
21 return 1 / i
; // expected-warning {{Division by zero}}
26 void *mem
= malloc(8);
28 return ERR
; // expected-warning {{Potential leak of memory pointed to by 'mem'}}
35 /* ☃ */ return 1 / løçål
; // expected-warning {{Division by zero}}