mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
f2f6ce65b7
input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
27 lines
849 B
LLVM
27 lines
849 B
LLVM
; RUN: opt < %s -simplify-libcalls -S | FileCheck %s
|
|
; PR4738
|
|
|
|
; SimplifyLibcalls shouldn't assume anything about weak symbols.
|
|
|
|
@real_init = weak_odr constant [2 x i8] c"y\00"
|
|
@fake_init = weak constant [2 x i8] c"y\00"
|
|
@.str = private constant [2 x i8] c"y\00"
|
|
|
|
; CHECK: define i32 @foo
|
|
; CHECK: call i32 @strcmp
|
|
define i32 @foo() nounwind {
|
|
entry:
|
|
%t0 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8]* @fake_init, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0)) nounwind readonly
|
|
ret i32 %t0
|
|
}
|
|
|
|
; CHECK: define i32 @bar
|
|
; CHECK: ret i32 0
|
|
define i32 @bar() nounwind {
|
|
entry:
|
|
%t0 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8]* @real_init, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0)) nounwind readonly
|
|
ret i32 %t0
|
|
}
|
|
|
|
declare i32 @strcmp(i8*, i8*) nounwind readonly
|