Skip to content

Commit 937ab67

Browse files
committed
Pre-commit test cases
1 parent 6f1013a commit 937ab67

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --include-generated-funcs --version 4
2+
; RUN: opt < %s -passes=globalopt -S | FileCheck %s
3+
4+
@f1_alias = linkonce_odr hidden alias void (), ptr @f1
5+
@f2_alias = linkonce_odr hidden alias void (), ptr @f2
6+
7+
define void @foo() {
8+
call void @f1_alias()
9+
ret void
10+
}
11+
12+
define void @bar() {
13+
call void @f1()
14+
ret void
15+
}
16+
17+
define void @baz() {
18+
call void @f2_alias()
19+
ret void
20+
}
21+
22+
; FIXME: We cannot use `f1_alias` to replace `f1` because they are both in use
23+
; and `f1_alias` could be replaced at link time.
24+
define internal void @f1() {
25+
ret void
26+
}
27+
28+
define internal void @f2() {
29+
ret void
30+
}
31+
; CHECK-LABEL: define void @foo() local_unnamed_addr {
32+
; CHECK-NEXT: call void @f1_alias()
33+
; CHECK-NEXT: ret void
34+
;
35+
;
36+
; CHECK-LABEL: define void @bar() local_unnamed_addr {
37+
; CHECK-NEXT: call void @f1_alias()
38+
; CHECK-NEXT: ret void
39+
;
40+
;
41+
; CHECK-LABEL: define void @baz() local_unnamed_addr {
42+
; CHECK-NEXT: call void @f2_alias()
43+
; CHECK-NEXT: ret void
44+
;
45+
;
46+
; CHECK-LABEL: define linkonce_odr hidden void @f1_alias() local_unnamed_addr {
47+
; CHECK-NEXT: ret void
48+
;
49+
;
50+
; CHECK-LABEL: define linkonce_odr hidden void @f2_alias() local_unnamed_addr {
51+
; CHECK-NEXT: ret void
52+
;

0 commit comments

Comments
 (0)