1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -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(i8*, i8*, ...)
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(i8* %dst) {
14; CHECK-LABEL: @test_simplify1(
15; CHECK-NEXT:    call void (i8*, i8*, ...) @sprintf(i8* [[DST:%.*]], i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0))
16; CHECK-NEXT:    ret void
17;
18  %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
19  call void (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt)
20  ret void
21}
22