[InstCombine] Signed saturation patterns
[llvm-core.git] / test / Transforms / InstCombine / unlocked-stdio-mingw.ll
blobf41b86654cbe5aa7ae654b714fc6a6ee6498ff4c
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S -mtriple=x86_64-w64-mingw32 | FileCheck %s
4 %struct._iobuf = type { i8*, i32, i8*, i32, i32, i32, i32, i8* }
6 @.str = private unnamed_addr constant [5 x i8] c"file\00", align 1
7 @.str.1 = private unnamed_addr constant [2 x i8] c"w\00", align 1
9 ; Check that this still uses the plain fputc instead of fputc_unlocked
10 ; for MinGW targets.
11 define void @external_fputc_test() {
12 ; CHECK-LABEL: @external_fputc_test(
13 ; CHECK-NEXT:    [[CALL:%.*]] = call %struct._iobuf* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
14 ; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @fputc(i32 99, %struct._iobuf* [[CALL]])
15 ; CHECK-NEXT:    ret void
17   %call = call %struct._iobuf* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
18   %call1 = call i32 @fputc(i32 99, %struct._iobuf* %call)
19   ret void
22 declare %struct._iobuf* @fopen(i8*, i8*)
23 declare i32 @fputc(i32, %struct._iobuf* nocapture)