Files
clang-p2996/llvm/test/CodeGen/X86/no-plt-libcalls.ll
Arthur Eubanks 1aa02b37e7 Revert "[BuildLibCalls/SimplifyLibCalls] Fix attributes on created CallInst instructions."
This reverts commit 1eda5453f2.

Causes https://crbug.com/1223647:
Incompatible argument and return types for 'returned' attribute
  tail call void @llvm.memset.p0i8.i64(i8* noalias noundef returned writeonly align 1 dereferenceable(255) %arraydecay, i8 0, i64 255, i1 false), !dbg !985
2021-06-24 19:24:34 -07:00

24 lines
955 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; Check if "RtLibUseGOT" works correctly when lib calls are simplified.
; RUN: opt < %s -instcombine -S | FileCheck %s
@percent_s = constant [4 x i8] c"%s\0A\00"
@hello_world = constant [13 x i8] c"hello world\0A\00"
declare i32 @printf(i8*, ...)
define void @printf_call() {
; CHECK-LABEL: @printf_call(
; CHECK-NEXT: [[PUTS:%.*]] = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i64 0, i64 0))
; CHECK-NEXT: ret void
;
%fmt = getelementptr [4 x i8], [4 x i8]* @percent_s, i32 0, i32 0
%str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
call i32 (i8*, ...) @printf(i8* %fmt, i8* %str)
ret void
}
; CHECK: Function Attrs: nofree nounwind nonlazybind
; CHECK-NEXT: declare noundef i32 @puts(i8* nocapture noundef readonly)
!llvm.module.flags = !{!0}
!0 = !{i32 7, !"RtLibUseGOT", i32 1}