diff --git a/clang/test/Sema/code_align.c b/clang/test/Sema/code_align.c index 539c0c0b0f1cc..2d1af7026a181 100644 --- a/clang/test/Sema/code_align.c +++ b/clang/test/Sema/code_align.c @@ -75,19 +75,23 @@ void foo1(int A) [[clang::code_align(9223372036854775808)]] for(int I=0; I<256; ++I) { bar(I); } +#ifdef __SIZEOF_INT128__ // expected-error@+1{{'code_align' attribute requires an integer argument which is a constant power of two between 1 and 4096 inclusive; provided argument was (__int128_t)1311768467294899680ULL << 64}} [[clang::code_align((__int128_t)0x1234567890abcde0ULL << 64)]] for(int I=0; I<256; ++I) { bar(I); } +#endif // expected-error@+1 {{'code_align' attribute requires an integer argument which is a constant power of two between 1 and 4096 inclusive; provided argument was -922337203685477}} [[clang::code_align(-922337203685477)]] for(int I=0; I<256; ++I) { bar(I); } +#ifdef __SIZEOF_INT128__ // cpp-local-error@+3{{expression is not an integral constant expression}} // cpp-local-note@+2{{left shift of negative value -1311768467294899680}} // c-local-error@+1{{'code_align' attribute requires an integer argument which is a constant power of two between 1 and 4096 inclusive; provided argument was -(__int128_t)1311768467294899680ULL << 64}} [[clang::code_align(-(__int128_t)0x1234567890abcde0ULL << 64)]] for(int I=0; I<256; ++I) { bar(I); } +#endif // cpp-local-error@+3{{expression is not an integral constant expression}} // cpp-local-note@+2{{function parameter 'A' with unknown value cannot be used in a constant expression}}