xref: /llvm-project/llvm/test/Transforms/InstCombine/sprintf-void.ll (revision 89274584eeca019d1ebe6e22ebfa9d03ce8563f2)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4target 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"
5
6@hello_world = constant [13 x i8] c"hello world\0A\00"
7
8declare void @sprintf(ptr, ptr, ...)
9
10; Check that a sprintf call, that would otherwise be optimized, but with
11; optimized out return type, doesn't crash the optimizer.
12
13define void @test_simplify1(ptr %dst) {
14; CHECK-LABEL: @test_simplify1(
15; CHECK-NEXT:    call void (ptr, ptr, ...) @sprintf(ptr [[DST:%.*]], ptr nonnull @hello_world)
16; CHECK-NEXT:    ret void
17;
18  call void (ptr, ptr, ...) @sprintf(ptr %dst, ptr @hello_world)
19  ret void
20}
21