(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
malloc-sarif-1.c
       1  /* { dg-do compile } */
       2  /* { dg-additional-options "-fdiagnostics-format=sarif-file" } */
       3  
       4  #include <stdlib.h>
       5  
       6  void test_1 (void)
       7  {
       8    void *ptr = malloc (1024);
       9    free (ptr);
      10    free (ptr);
      11  }
      12  
      13  /* Verify SARIF output.
      14  
      15     The threadFlowLocation objects should have "kinds" properties
      16     reflecting the meanings of the events:
      17       { dg-final { scan-sarif-file "\"kinds\": \\\[\"acquire\", \"memory\"\\\]" } }
      18       { dg-final { scan-sarif-file "\"kinds\": \\\[\"release\", \"memory\"\\\]" } }
      19       { dg-final { scan-sarif-file "\"kinds\": \\\[\"danger\"\\\]" } }
      20  */