diff options
| author | Stefan Stipanovic <sstipanovic@s-energize.com> | 2019-12-17 20:41:09 +0100 |
|---|---|---|
| committer | Stefan Stipanovic <sstipanovic@s-energize.com> | 2019-12-17 20:41:09 +0100 |
| commit | fff8ec98139379968cc7cebb71d771cf58a39a5c (patch) | |
| tree | 8081a0a194e05902e17d08267fb79ba12aa31eba /llvm/test | |
| parent | d020e67575d9806d318787eec9d71828eab8f57a (diff) | |
| download | bcm5719-llvm-fff8ec98139379968cc7cebb71d771cf58a39a5c.tar.gz bcm5719-llvm-fff8ec98139379968cc7cebb71d771cf58a39a5c.zip | |
[Attributor] H2S fix.
Summary: Fixing issues that were noticed in D71521
Reviewers: jdoerfert, lebedev.ri, uenoku
Subscribers:
Differential Revision: https://reviews.llvm.org/D71564
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/Attributor/heap_to_stack.ll | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/llvm/test/Transforms/Attributor/heap_to_stack.ll b/llvm/test/Transforms/Attributor/heap_to_stack.ll index bac01253997..3d8b1b3aace 100644 --- a/llvm/test/Transforms/Attributor/heap_to_stack.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack.ll @@ -313,15 +313,27 @@ define i32 @test13() { define i32 @test_sle() { %1 = tail call noalias i8* @malloc(i64 -1) - ; FIXME: This should not be transformed - ; CHECK: %1 = alloca i8, i64 -1 - ; CHECK-NEXT: @no_sync_func(i8* noalias nocapture nofree %1) + ; CHECK: %1 = tail call noalias i8* @malloc(i64 -1) + ; CHECK-NEXT: @no_sync_func(i8* noalias nofree %1) tail call void @no_sync_func(i8* %1) %2 = bitcast i8* %1 to i32* store i32 10, i32* %2 %3 = load i32, i32* %2 tail call void @free(i8* %1) - ; CHECK-NOT: tail call void @free(i8* noalias %1) + ; CHECK: tail call void @free(i8* noalias %1) + ret i32 %3 +} + +define i32 @test_overflow() { + %1 = tail call noalias i8* @calloc(i64 65537, i64 65537) + ; CHECK: %1 = tail call noalias i8* @calloc(i64 65537, i64 65537) + ; CHECK-NEXT: @no_sync_func(i8* noalias nofree %1) + tail call void @no_sync_func(i8* %1) + %2 = bitcast i8* %1 to i32* + store i32 10, i32* %2 + %3 = load i32, i32* %2 + tail call void @free(i8* %1) + ; CHECK: tail call void @free(i8* noalias %1) ret i32 %3 } |

