r177035 - Add support for the 'endian' attribute for OpenCL.

Dmitri Gribenko gribozavr at gmail.com
Thu Mar 14 06:00:50 PDT 2013


On Thu, Mar 14, 2013 at 11:54 AM, Joey Gouly <joey.gouly at arm.com> wrote:
> --- cfe/trunk/test/SemaOpenCL/endian-attr.cl (added)
> +++ cfe/trunk/test/SemaOpenCL/endian-attr.cl Thu Mar 14 04:54:43 2013
> @@ -0,0 +1,9 @@
> +// RUN: %clang_cc1 -verify %s
> +
> +constant long a __attribute__((endian(host))) = 100;
> +
> +constant long b __attribute__((endian(device))) = 100;
> +
> +constant long c __attribute__((endian(none))) = 100; // expected-warning {{unknown endian 'none'}}
> +
> +void func() __attribute__((endian(host))); // expected-warning {{endian attribute only applies to variables}}

Why just warn here?  Is there some legacy code we need to be compatible with?

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list