aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr51644.c
blob: 2038a0c4b930481a3fa980aac3ec9363e064bc73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* PR middle-end/51644 */
/* { dg-do compile } */
/* { dg-options "-Wall -fexceptions" } */

#include <stdarg.h>

extern void baz (int, va_list) __attribute__ ((__noreturn__));

__attribute__ ((__noreturn__))
void
foo (int s, ...)
{
  va_list ap;
  va_start (ap, s);
  baz (s, ap);
  va_end (ap);
}		/* { dg-bogus "function does return" } */

__attribute__ ((__noreturn__))
void
bar (int s, ...)
{
  va_list ap1;
  va_start (ap1, s);
  {
    va_list ap2;
    va_start (ap2, s);
    baz (s, ap1);
    baz (s, ap2);
    va_end (ap2);
  }
  va_end (ap1);
}		/* { dg-bogus "function does return" } */