Le 1 mars 2012 à 18:20, Jonathan Sauer a écrit :

> Hello,
> 
>> Added: cfe/trunk/test/Preprocessor/has_attribute.c
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/has_attribute.c?rev=151809&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/Preprocessor/has_attribute.c (added)
>> +++ cfe/trunk/test/Preprocessor/has_attribute.c Thu Mar  1 08:53:16 2012
>> @@ -0,0 +1,14 @@
>> +// RUN: %clang_cc1 %s
>> +// RUN: %clang_cc1 %s -E
>> +#ifndef __has_attribute
>> +#error Should have __has_attribute
>> +#endif
>> +
>> +#if __has_attribute(something_we_dont_have)
>> +#error Bad
>> +#endif
>> +
>> +#if !__has_attribute(__always_inline__) || \
>> +    !__has_attribute(always_inline)
>> +#error Clang should have this
>> +#endif
> 
> From my attempt at extending the __has_attribute check ;-) I discovered that 
> there already is a test
> for __has_attribute, albeit in test/Lexer/has_attribute.cpp. Attached is a 
> patch that merges both into
> the new test, as __has_attribute is handled in the preprocessor, not the 
> lexer (I also took the liberty
> of adapting the test to clang's test framework).


Thanks. commited as r151819

-- Jean-Daniel





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

Reply via email to