Linker: Update -override testcase to check callers

Check that `@main` is calling `@foo2` (the renamed internal function),
not the `@foo` with external linkage that's been pulled in from the
override file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235730 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-04-24 16:56:24 +00:00
parent 794cd3418b
commit 956b1fff6c

View File

@ -1,23 +1,25 @@
; RUN: llvm-link %s -override %S/Inputs/override-with-internal-linkage.ll -S | FileCheck %s
; RUN: llvm-link -override %S/Inputs/override-with-internal-linkage.ll %s -S | FileCheck %s
; CHECK-LABEL: define internal i32 @foo2
; CHECK-LABEL: define i32 @main(
; CHECK-NEXT: entry:
; CHECK-NEXT: call i32 @foo2(
define i32 @main(i32 %argc, i8** %argv) {
entry:
%a = call i32 @foo(i32 2)
ret i32 %a
}
; CHECK-LABEL: define internal i32 @foo2(
; CHECK-NEXT: entry:
; CHECK-NEXT: %add = add nsw i32 %i, %i
; CHECK-NEXT: ret i32 %add
; CHECK-LABEL: define i32 @foo
; CHECK-NEXT: entry:
; CHECK-NEXT: ret i32 4
define internal i32 @foo(i32 %i) {
entry:
%add = add nsw i32 %i, %i
ret i32 %add
}
; Function Attrs: nounwind ssp uwtable
define i32 @main(i32 %argc, i8** %argv) {
entry:
%a = call i32 @foo(i32 2)
ret i32 %a
}
; CHECK-LABEL: define i32 @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: ret i32 4