86 lines · plain
1; Regression test for safestack layout. Used to fail with asan.2; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s3; RUN: opt -passes=safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s4 5define void @f() safestack {6; CHECK-LABEL: define void @f7entry:8; CHECK: %[[USP:.*]] = load ptr, ptr @__safestack_unsafe_stack_ptr9; CHECK: getelementptr i8, ptr %[[USP]], i32 -22410 11 %x0 = alloca i8, align 1612 %x1 = alloca i8, align 1613 %x2 = alloca i8, align 1614 %x3 = alloca i8, align 1615 %x4 = alloca i8, align 1616 %x5 = alloca i8, align 1617 %x6 = alloca i8, align 1618 %x7 = alloca i8, align 1619 %x8 = alloca i8, align 1620 %x9 = alloca i8, align 1621 %x10 = alloca i8, align 1622 %x11 = alloca i8, align 1623 %x12 = alloca i8, align 1624 %x13 = alloca i8, align 1625 %y0 = alloca i8, align 226 %y1 = alloca i8, align 227 %y2 = alloca i8, align 228 %y3 = alloca i8, align 229 %y4 = alloca i8, align 230 %y5 = alloca i8, align 231 %y6 = alloca i8, align 232 %y7 = alloca i8, align 233 %y8 = alloca i8, align 234 35; CHECK: getelementptr i8, ptr %[[USP]], i32 -1636 call void @capture8(ptr %x0)37; CHECK: getelementptr i8, ptr %[[USP]], i32 -3238 call void @capture8(ptr %x1)39; CHECK: getelementptr i8, ptr %[[USP]], i32 -4840 call void @capture8(ptr %x2)41; CHECK: getelementptr i8, ptr %[[USP]], i32 -6442 call void @capture8(ptr %x3)43; CHECK: getelementptr i8, ptr %[[USP]], i32 -8044 call void @capture8(ptr %x4)45; CHECK: getelementptr i8, ptr %[[USP]], i32 -9646 call void @capture8(ptr %x5)47; CHECK: getelementptr i8, ptr %[[USP]], i32 -11248 call void @capture8(ptr %x6)49; CHECK: getelementptr i8, ptr %[[USP]], i32 -12850 call void @capture8(ptr %x7)51; CHECK: getelementptr i8, ptr %[[USP]], i32 -14452 call void @capture8(ptr %x8)53; CHECK: getelementptr i8, ptr %[[USP]], i32 -16054 call void @capture8(ptr %x9)55; CHECK: getelementptr i8, ptr %[[USP]], i32 -17656 call void @capture8(ptr %x10)57; CHECK: getelementptr i8, ptr %[[USP]], i32 -19258 call void @capture8(ptr %x11)59; CHECK: getelementptr i8, ptr %[[USP]], i32 -20860 call void @capture8(ptr %x12)61; CHECK: getelementptr i8, ptr %[[USP]], i32 -22462 call void @capture8(ptr %x13)63; CHECK: getelementptr i8, ptr %[[USP]], i32 -264 call void @capture8(ptr %y0)65; CHECK: getelementptr i8, ptr %[[USP]], i32 -466 call void @capture8(ptr %y1)67; CHECK: getelementptr i8, ptr %[[USP]], i32 -668 call void @capture8(ptr %y2)69; CHECK: getelementptr i8, ptr %[[USP]], i32 -870 call void @capture8(ptr %y3)71; CHECK: getelementptr i8, ptr %[[USP]], i32 -1072 call void @capture8(ptr %y4)73; CHECK: getelementptr i8, ptr %[[USP]], i32 -1274 call void @capture8(ptr %y5)75; CHECK: getelementptr i8, ptr %[[USP]], i32 -1476 call void @capture8(ptr %y6)77; CHECK: getelementptr i8, ptr %[[USP]], i32 -1878 call void @capture8(ptr %y7)79; CHECK: getelementptr i8, ptr %[[USP]], i32 -2080 call void @capture8(ptr %y8)81 82 ret void83}84 85declare void @capture8(ptr)86