1 ; RUN: opt < %s -passes=globalopt -S | FileCheck %s
3 @foo1 = alias void (), ptr @foo2
4 ;; foo2 is dso_local and non-weak. Resolved.
5 ; CHECK: @foo1 = alias void (), ptr @bar2
7 @foo2 = dso_local alias void(), ptr @bar1
8 ;; bar1 is dso_local and non-weak. Resolved.
9 ; CHECK: @foo2 = dso_local alias void (), ptr @bar2
11 @bar1 = dso_local alias void (), ptr @bar2
12 ; CHECK: @bar1 = dso_local alias void (), ptr @bar2
14 @weak1 = weak dso_local alias void (), ptr @bar2
15 ;; weak1 may be replaced with another definition in the linkage unit. Not resolved.
16 ; CHECK: @weak1 = weak dso_local alias void (), ptr @bar2
18 @bar4 = private unnamed_addr constant [2 x ptr] zeroinitializer
19 @foo4 = weak_odr unnamed_addr alias ptr, getelementptr inbounds ([2 x ptr], ptr @bar4, i32 0, i32 1)
20 ; CHECK: @foo4 = weak_odr unnamed_addr alias ptr, getelementptr inbounds ([2 x ptr], ptr @bar4, i32 0, i32 1)
22 @priva = private alias void (), ptr @bar5
23 ; CHECK: @priva = private alias void (), ptr @bar5
25 define dso_local void @bar2() {
28 ; CHECK: define dso_local void @bar2()
30 define weak void @bar5() {
33 ; CHECK: define weak void @bar5()
38 ;; foo1 is dso_preemptable. Not resolved.
39 ; CHECK: call void @foo1()
42 ;; foo2 is dso_local and non-weak. Resolved.
43 ; CHECK: call void @bar2()
46 ;; bar1 is dso_local and non-weak. Resolved.
47 ; CHECK: call void @bar2()
50 ;; weak1 is weak. Not resolved.
51 ; CHECK: call void @weak1()
54 ;; priva has a local linkage. Resolved.
55 ; CHECK: call void @priva()
60 @foo3 = dso_local alias void (), ptr @bar3
63 define internal void @bar3() {
66 ;CHECK: define dso_local void @foo3