]> granicus.if.org Git - clang/commitdiff
Fix test failure with 374562 on Hexagon
authorErich Keane <erich.keane@intel.com>
Fri, 11 Oct 2019 16:30:45 +0000 (16:30 +0000)
committerErich Keane <erich.keane@intel.com>
Fri, 11 Oct 2019 16:30:45 +0000 (16:30 +0000)
__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

test/Sema/builtin-assume-aligned.c

index 9411cb4e6389b08d0f7866aa02ba4a74240130b4..565dc66094420545b063ce335ec38484c0994d45 100644 (file)
@@ -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];
 }