1 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
2 ; <rdar://problem/9815881>
3 ; On OSX x86-32, fwrite and fputs aren't called fwrite and fputs.
4 ; Make sure we use the correct names.
6 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-n8:16:32-S128"
7 target triple = "i386-apple-macosx10.7.2"
9 %struct.__sFILE = type { ptr, i32, i32, i16, i16, %struct.__sbuf, i32, ptr, ptr, ptr, ptr, ptr, %struct.__sbuf, ptr, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
10 %struct.__sbuf = type { ptr, i32 }
11 %struct.__sFILEX = type opaque
13 @.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00", align 1
14 @.str2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
16 define void @test1(ptr %stream) nounwind {
17 ; CHECK-LABEL: define void @test1(
18 ; CHECK: call i32 @"fwrite$UNIX2003"
19 %call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %stream, ptr @.str) nounwind
23 define void @test2(ptr %stream, ptr %str) nounwind ssp {
24 ; CHECK-LABEL: define void @test2(
25 ; CHECK: call i32 @"fputs$UNIX2003"
26 %call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %stream, ptr @.str2, ptr %str) nounwind
30 declare i32 @fprintf(ptr, ptr, ...) nounwind