21 lines
771 B
LLVM
21 lines
771 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
|
|
|
|
@hello_world = constant [13 x i8] c"hello world\0A\00"
|
|
|
|
declare void @sprintf(ptr, ptr, ...)
|
|
|
|
; Check that a sprintf call, that would otherwise be optimized, but with
|
|
; optimized out return type, doesn't crash the optimizer.
|
|
|
|
define void @test_simplify1(ptr %dst) {
|
|
; CHECK-LABEL: @test_simplify1(
|
|
; CHECK-NEXT: call void (ptr, ptr, ...) @sprintf(ptr [[DST:%.*]], ptr nonnull @hello_world)
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void (ptr, ptr, ...) @sprintf(ptr %dst, ptr @hello_world)
|
|
ret void
|
|
}
|