memset_chk-simplify-nobuiltin.ll 677 B

123456789101112131415161718
  1. ; RUN: opt -S -disable-simplify-libcalls -codegenprepare < %s | FileCheck %s
  2. target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
  3. ; This is a workaround for PR23093: when building with -mkernel/-fno-builtin,
  4. ; we still generate fortified library calls.
  5. ; Check that we ignore two things:
  6. ; - attribute nobuiltin
  7. ; - TLI::has (always returns false thanks to -disable-simplify-libcalls)
  8. ; CHECK-NOT: _chk
  9. ; CHECK: call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 %len, i32 1, i1 false)
  10. define void @test_nobuiltin(i8* %dst, i64 %len) {
  11. call i8* @__memset_chk(i8* %dst, i32 0, i64 %len, i64 -1) nobuiltin
  12. ret void
  13. }
  14. declare i8* @__memset_chk(i8*, i32, i64, i64)