brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 11009b7 Raw
42 lines · plain
1; Verify that a ud2 is generated after the call to __stack_chk_fail.2 3; RUN: llc < %s -mtriple=x86_64-scei-ps4 -enable-selectiondag-sp=false -O0 -o - | FileCheck %s4; RUN: llc < %s -mtriple=x86_64-sie-ps5  -enable-selectiondag-sp=false -O0 -o - | FileCheck %s5; RUN: llc < %s -mtriple=x86_64-scei-ps4 -enable-selectiondag-sp=false -O2 -o - | FileCheck %s6; RUN: llc < %s -mtriple=x86_64-sie-ps5  -enable-selectiondag-sp=false -O2 -o - | FileCheck %s7; RUN: llc < %s -mtriple=x86_64-scei-ps4 -enable-selectiondag-sp=true  -O0 -o - | FileCheck %s8; RUN: llc < %s -mtriple=x86_64-sie-ps5  -enable-selectiondag-sp=true  -O0 -o - | FileCheck %s9; RUN: llc < %s -mtriple=x86_64-scei-ps4 -enable-selectiondag-sp=true  -O2 -o - | FileCheck %s10; RUN: llc < %s -mtriple=x86_64-sie-ps5  -enable-selectiondag-sp=true  -O2 -o - | FileCheck %s11 12 13; CHECK: check_input:14; CHECK: callq __stack_chk_fail15; CHECK-NEXT: ud216; CHECK: .size	check_input17; CHECK-NEXT: .cfi_endproc18 19@.str = private unnamed_addr constant [37 x i8] c"????????????????????????????????????\00", align 120 21define signext i8 @check_input(ptr %input) nounwind uwtable ssp {22entry:23  %input.addr = alloca ptr, align 824  %buf = alloca [16 x i8], align 1625  store ptr %input, ptr %input.addr, align 826  %0 = load ptr, ptr %input.addr, align 827  %call = call ptr @strcpy(ptr %buf, ptr %0) nounwind28  %1 = load i8, ptr %buf, align 129  ret i8 %130}31 32declare ptr @strcpy(ptr, ptr) nounwind33 34define i32 @main() nounwind uwtable ssp {35entry:36  %retval = alloca i32, align 437  store i32 0, ptr %retval38  %call = call signext i8 @check_input(ptr @.str)39  %conv = sext i8 %call to i3240  ret i32 %conv41}42