diff options
author | Erich Keane <erich.keane@intel.com> | 2019-10-10 21:08:28 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-10-10 21:08:28 +0000 |
commit | 726918e196b413bcd80f08494c061fd6b3f26c94 (patch) | |
tree | f99f1c3dd2b7112ac694e7b026b6a924dbc27fbc /test | |
parent | c677d420e10769596cb21a859d7896139adc8be5 (diff) | |
download | clang-726918e196b413bcd80f08494c061fd6b3f26c94.tar.gz |
Fix __builtin_assume_aligned with too large values.
Code to handle __builtin_assume_aligned was allowing larger values, but
would convert this to unsigned along the way. This patch removes the
EmitAssumeAligned overloads that take unsigned to do away with this
problem.
Additionally, it adds a warning that values greater than 1 <<29 are
ignored by LLVM.
Differential Revision: https://reviews.llvm.org/D68824
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Sema/builtin-assume-aligned.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/builtin-assume-aligned.c b/test/Sema/builtin-assume-aligned.c index 057a500b32..a669ed172d 100644 --- a/test/Sema/builtin-assume-aligned.c +++ b/test/Sema/builtin-assume-aligned.c @@ -58,3 +58,7 @@ void *test_no_fn_proto() __attribute__((assume_aligned)); // expected-error {{'a void *test_no_fn_proto() __attribute__((assume_aligned())); // expected-error {{'assume_aligned' attribute takes at least 1 argument}} 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 268435456 bytes or smaller; assumption ignored}} +return a[0]; +} |