xref: /llvm-project/llvm/test/Transforms/InstCombine/strncmp-wrong-datalayout.ll (revision 4ab40eca080965c65802710e39adbb78c4ce7bde)
1; Test that the strncpy simplification doesn't crash if datalayout specifies
2; 64 bit pointers while length is a 32 bit argument
3;
4; RUN: opt < %s -passes=instcombine -S | FileCheck %s
5
6target datalayout = "e-p:64:64:64"
7
8declare i32 @strncmp(ptr, ptr, i32)
9
10define i32 @test6(ptr %str1, ptr %str2) {
11; CHECK-LABEL: @test6(
12; CHECK: call i32 @strncmp(ptr %str1, ptr %str2, i32 1)
13
14  %temp1 = call i32 @strncmp(ptr %str1, ptr %str2, i32 1)
15  ret i32 %temp1
16}
17