xref: /llvm-project/llvm/test/Analysis/StackSafetyAnalysis/i386-bug-fix.ll (revision 7cf5581712b24d4aea5dffa2e23f0ed42af1954d)
1; REQUIRES: x86-registered-target
2
3; RUN: opt -passes="print-stack-safety" -disable-output %s 2>&1 | FileCheck %s --check-prefixes=CHECK
4
5; CHECK:      @main
6; CHECK-NEXT:   args uses:
7; CHECK-NEXT:     argv[]: empty-set
8; CHECK-NEXT:   allocas uses:
9; CHECK-NEXT:     [4]: [0,4)
10; CHECK-NEXT:     [32]: full-set
11; CHECK-NEXT:   safe accesses:
12
13target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
14target triple = "i386-pc-linux-gnu"
15
16; Function Attrs: mustprogress norecurse sanitize_address uwtable
17define dso_local i32 @main(i32 %argc, ptr %argv)  {
18entry:
19  %0 = alloca i32, align 4
20  %1 = alloca i8, i64 32, align 32
21  %2 = ptrtoint ptr %1 to i32
22  store i32 %2, ptr %0, align 4
23  ret i32 0
24}
25