(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
plugin/
diagnostic-test-paths-3.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-fdiagnostics-format=json" } */
       3  
       4  #include <stddef.h>
       5  #include <stdlib.h>
       6  
       7  /* Minimal reimplementation of cpython API.  */
       8  typedef struct PyObject {} PyObject;
       9  extern int PyArg_ParseTuple (PyObject *args, const char *fmt, ...);
      10  extern PyObject *PyList_New (int);
      11  extern PyObject *PyLong_FromLong(long);
      12  extern void PyList_Append(PyObject *list, PyObject *item);
      13  
      14  PyObject *
      15  make_a_list_of_random_ints_badly(PyObject *self,
      16  				 PyObject *args)
      17  {
      18    PyObject *list, *item;
      19    long count, i;
      20  
      21    if (!PyArg_ParseTuple(args, "i", &count)) {
      22      return NULL;
      23    }
      24  
      25    list = PyList_New(0);
      26  	
      27    for (i = 0; i < count; i++) {
      28      item = PyLong_FromLong(random());
      29      PyList_Append(list, item);
      30    }
      31    
      32    return list;
      33  }
      34  
      35  /* FIXME: test the events within a path.  */
      36  /* { dg-regexp "\"kind\": \"error\"" } */
      37  /* { dg-regexp "\"path\": " } */
      38  /* { dg-regexp ".*" } */