Dmitri Gribenko <[email protected]> writes:
> On Wed, Aug 21, 2013 at 6:37 PM, Peter N Lewis <[email protected]> wrote:
>> On 22/08/2013, at 0:37 , Richard Sandiford
>> <[email protected]> wrote:
>>> Author: rsandifo
>>> Date: Wed Aug 21 11:37:37 2013
>>> New Revision: 188905
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=188905&view=rev
>>> Log:
>>> Tweak gnu-flags.c test for z, where globals have 2-byte alignment by default
>>>
>>> Modified:
>>>    cfe/trunk/test/Sema/gnu-flags.c
>>>
>>> Modified: cfe/trunk/test/Sema/gnu-flags.c
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/gnu-flags.c?rev=188905&r1=188904&r2=188905&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/test/Sema/gnu-flags.c (original)
>>> +++ cfe/trunk/test/Sema/gnu-flags.c Wed Aug 21 11:37:37 2013
>>> @@ -20,12 +20,18 @@
>>> #endif
>>>
>>>
>>> +#ifdef __s390x__
>>> +#define EXPECTED_ALIGN 2
>>> +#else
>>> +#define EXPECTED_ALIGN 1
>>> +#endif
>>> +
>>> #if ALL || ALIGNOF
>>> // expected-warning@+4 {{'_Alignof' applied to an expression is a GNU
>>> extension}}
>>> #endif
>>>
>>> char align;
>>> -_Static_assert(_Alignof(align) == 1, "align's alignment is wrong");
>>> +_Static_assert(_Alignof(align) == EXPECTED_ALIGN, "align's alignment
>>> is wrong");
>>
>> Since the test is only meant to be testing the _Alignof warning,
>> unless you really want to test the _Alignof value, a better patch
>> would be to just ignore the value of _Alignof :
>>
>> Index: gnu-flags.c
>> ===================================================================
>> --- gnu-flags.c (revision 188975)
>> +++ gnu-flags.c (working copy)
>> @@ -31,7 +31,7 @@
>>  #endif
>>
>>  char align;
>> -_Static_assert(_Alignof(align) == EXPECTED_ALIGN, "align's alignment
>> is wrong");
>> +const int alignis = _Alignof(align);
>>
>>
>>  #if ALL || CASERANGE
>>
>> That avoids any hardware dependencies.
>
> Relaxed the check in r188993.

Thanks.

Richard

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to