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

Rahul Jain 1989.rahuljain at gmail.com
Tue Apr 1 22:55:56 PDT 2014


Gentle ping!

Please if someone could help review this small patch!

Thanks,
Rahul


On Mon, Mar 24, 2014 at 5:42 PM, Rahul Jain <1989.rahuljain at gmail.com>wrote:

> Gentle ping!
>
>
> On Thu, Mar 20, 2014 at 9:18 AM, Rahul Jain <1989.rahuljain at gmail.com>wrote:
>
>> Gentle ping!
>>
>>
>> On Sun, Mar 16, 2014 at 11:01 PM, Rahul Jain <1989.rahuljain at gmail.com>wrote:
>>
>>>
>>> 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/20140402/ce44e04d/attachment.html>


More information about the cfe-commits mailing list