From: Erich Keane Date: Fri, 11 Oct 2019 16:30:45 +0000 (+0000) Subject: Fix test failure with 374562 on Hexagon X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2a98c1dd3e9ca759d78992cadfbdf994e544838;p=clang Fix test failure with 374562 on Hexagon __builtin_assume_aligned takes a size_t which is a 32 bit int on hexagon. Thus, the constant gets converted to a 32 bit value, resulting in 0 not being a power of 2. This patch changes the constant being passed to 2**30 so that it fails, but doesnt exceed 30 bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374569 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/builtin-assume-aligned.c b/test/Sema/builtin-assume-aligned.c index 9411cb4e63..565dc66094 100644 --- a/test/Sema/builtin-assume-aligned.c +++ b/test/Sema/builtin-assume-aligned.c @@ -59,6 +59,6 @@ void *test_no_fn_proto() __attribute__((assume_aligned())); // expected-error {{ void *test_no_fn_proto() __attribute__((assume_aligned(32, 45, 37))); // expected-error {{'assume_aligned' attribute takes no more than 2 arguments}} int pr43638(int *a) { - a = __builtin_assume_aligned(a, 4294967296); // expected-warning {{requested alignment must be 536870912 bytes or smaller; maximum alignment assumed}} + a = __builtin_assume_aligned(a, 1073741824); // expected-warning {{requested alignment must be 536870912 bytes or smaller; maximum alignment assumed}} return a[0]; }