brintos

brintos / llvm-project-archived public Read only

0
0
Text · 925 B · 1a292b5 Raw
28 lines · plain
1; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s2; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s3; RUN: opt -passes=safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s4; RUN: opt -passes=safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s5 6@.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 17 8; no safestack attribute9; Requires no protector.10 11; CHECK-NOT: __safestack_unsafe_stack_ptr12 13; CHECK: @foo14define void @foo(ptr %a) nounwind uwtable {15entry:16  ; CHECK-NOT: __safestack_unsafe_stack_ptr17  %a.addr = alloca ptr, align 818  %buf = alloca [16 x i8], align 1619  store ptr %a, ptr %a.addr, align 820  %0 = load ptr, ptr %a.addr, align 821  %call = call ptr @strcpy(ptr %buf, ptr %0)22  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)23  ret void24}25 26declare ptr @strcpy(ptr, ptr)27declare i32 @printf(ptr, ...)28