diff options
Diffstat (limited to 'transform/testdata/allocs.ll')
-rw-r--r-- | transform/testdata/allocs.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/transform/testdata/allocs.ll b/transform/testdata/allocs.ll index 0511d79df..42932f4fe 100644 --- a/transform/testdata/allocs.ll +++ b/transform/testdata/allocs.ll @@ -1,6 +1,8 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7m-none-eabi" [email protected] = internal global i8 0, align 1 + declare nonnull i8* @runtime.alloc(i32) ; Test allocating a single int (i32) that should be allocated on the stack. @@ -68,6 +70,14 @@ end: ret void } +; Test a zero-sized allocation. +define void @testZeroSizedAlloc() { + %1 = call i8* @runtime.alloc(i32 0) + %2 = bitcast i8* %1 to i32* + %3 = call i32* @noescapeIntPtr(i32* %2) + ret void +} + declare i32* @escapeIntPtr(i32*) declare i32* @noescapeIntPtr(i32* nocapture) |