xref: /llvm-project/llvm/test/CodeGen/Inputs/stack-guard-reassign.ll (revision e018cbf7208b3d34f18997ddee84c66cee32fb1b)
139fc2843SFrancis Visoiu Mistrihdefine i32 @fn(i8* %str) #0 {
239fc2843SFrancis Visoiu Mistrihentry:
339fc2843SFrancis Visoiu Mistrih  %str.addr = alloca i8*, align 4
439fc2843SFrancis Visoiu Mistrih  %buffer = alloca [65536 x i8], align 1
539fc2843SFrancis Visoiu Mistrih  store i8* %str, i8** %str.addr, align 4
639fc2843SFrancis Visoiu Mistrih  %arraydecay = getelementptr inbounds [65536 x i8], [65536 x i8]* %buffer, i32 0, i32 0
739fc2843SFrancis Visoiu Mistrih  %0 = load i8*, i8** %str.addr, align 4
839fc2843SFrancis Visoiu Mistrih  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
939fc2843SFrancis Visoiu Mistrih  %arraydecay1 = getelementptr inbounds [65536 x i8], [65536 x i8]* %buffer, i32 0, i32 0
1039fc2843SFrancis Visoiu Mistrih  %call2 = call i32 @puts(i8* %arraydecay1)
1139fc2843SFrancis Visoiu Mistrih  %arrayidx = getelementptr inbounds [65536 x i8], [65536 x i8]* %buffer, i32 0, i32 65535
1239fc2843SFrancis Visoiu Mistrih  %1 = load i8, i8* %arrayidx, align 1
1339fc2843SFrancis Visoiu Mistrih  %conv = zext i8 %1 to i32
1439fc2843SFrancis Visoiu Mistrih  ret i32 %conv
1539fc2843SFrancis Visoiu Mistrih}
1639fc2843SFrancis Visoiu Mistrih
1739fc2843SFrancis Visoiu Mistrihdeclare i8* @strcpy(i8*, i8*)
1839fc2843SFrancis Visoiu Mistrih
1939fc2843SFrancis Visoiu Mistrihdeclare i32 @puts(i8*)
2039fc2843SFrancis Visoiu Mistrih
2139fc2843SFrancis Visoiu Mistrihattributes #0 = { noinline nounwind optnone ssp }
22*e018cbf7SFangrui Song
23*e018cbf7SFangrui Song!llvm.module.flags = !{!0}
24*e018cbf7SFangrui Song!0 = !{i32 7, !"direct-access-external-data", i32 1}
25