1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt < %s -instcombine -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s 3 4target datalayout = "e-m:o-p:40:64:64:32-i64:64-f80:128-n8:16:32:64-S128" 5%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] } 6%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } 7@.str = private unnamed_addr constant [5 x i8] c"file\00", align 1 8@.str.1 = private unnamed_addr constant [2 x i8] c"w\00", align 1 9@.str.2 = private unnamed_addr constant [4 x i8] c"str\00", align 1 10 11; Check fwrite is generated with arguments of ptr size, not index size 12define internal void @fputs_test_custom_dl() { 13; CHECK-LABEL: @fputs_test_custom_dl( 14; CHECK-NEXT: [[TMP1:%.*]] = call %struct._IO_FILE* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0)) 15; 16 %call = call %struct._IO_FILE* @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)) 17 %call1 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %struct._IO_FILE* %call) 18 ret void 19} 20 21declare %struct._IO_FILE* @fopen(i8*, i8*) 22declare i32 @fputs(i8* nocapture readonly, %struct._IO_FILE* nocapture) 23