1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll
Fangrui Song 1e7c397a16 [CodeGenPrepare] Make TargetPassConfig required
The code paths in the absence of TargetMachine, TargetLowering or
TargetRegisterInfo are poorly tested. As rL285987 said, requiring
TargetPassConfig allows us to delete many (untested) checks littered
everywhere.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73754
2020-02-02 09:28:45 -08:00

22 lines
827 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=x86_64 -disable-simplify-libcalls -codegenprepare < %s | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
; This is a workaround for PR23093: when building with -mkernel/-fno-builtin,
; we still generate fortified library calls.
; Check that we ignore two things:
; - attribute nobuiltin
; - TLI::has (always returns false thanks to -disable-simplify-libcalls)
define void @test_nobuiltin(i8* %dst, i64 %len) {
; CHECK-LABEL: @test_nobuiltin(
; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[DST:%.*]], i8 0, i64 [[LEN:%.*]], i1 false) #1
; CHECK-NEXT: ret void
;
call i8* @__memset_chk(i8* %dst, i32 0, i64 %len, i64 -1) nobuiltin
ret void
}
declare i8* @__memset_chk(i8*, i32, i64, i64)