PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / asan / pr80166.c
blob629dd23a31ca76817ddfdd3ca6d85f34bea0935a
1 /* PR sanitizer/80166 */
2 /* { dg-do run } */
4 #include <sys/types.h>
5 #include <unistd.h>
7 int
8 main (int argc, char **argv)
10 gid_t groups;
11 int r = getgroups (0, &groups);
12 if (r < 0)
13 __builtin_abort ();
15 r = getgroups (-1, &groups);
16 if (r != -1)
17 __builtin_abort ();
19 r = getgroups (-1, NULL);
20 if (r != -1)
21 __builtin_abort ();
23 return 0;