[Patch] Missed evaluation in "type" parameter of va_arg

Rahul Jain 1989.rahuljain at gmail.com
Sun Mar 16 10:31:09 PDT 2014


Hi All,

clang -v

clang version 3.5.0 (204017)

Target: x86_64-apple-darwin13.1.0
Thread model: posix

This is with respect to the following tc from gcc test suite:

#include <stdarg.h>


extern void exit (int);

extern void abort (void);


int a[10];

int i = 9;


void

f (int n, ...)

{

  va_list ap;

  void *p;

  va_start (ap, n);

  p = va_arg (ap, typeof (int (*)[++i]));

  if (p != a)

    abort ();

  if (i != n)

    abort ();

  va_end (ap);

}


int

main (void)

{

  f (10, &a);

  exit (0);

}


clang fails to emit code for increment operation done in the call to va_arg.

I have attached a patch which fixes the same.

Please if someone could help in reviewing it.


Also it would be great if someone could help/redirect me, as to what is the
format

used by to add regression test cases testing runtime behaviour of a tc?


Thanks,

Rahul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140316/77eba0ab/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vla.patch
Type: application/octet-stream
Size: 618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140316/77eba0ab/attachment.obj>


More information about the cfe-commits mailing list