summaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/NameAnonGlobals/rename.ll
blob: 4a2e47c67299d6815e3b2b45d41800fd6cbe6794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; RUN: opt -S -passes=name-anon-globals %s | FileCheck %s
; RUN: opt -passes='thinlto-pre-link<O0>,require<module-summary>' -o %t.bc < %s


; foo contribute to the unique hash for the module
define void @foo() {
    ret void
}

; bar is internal, and does not contribute to the unique hash for the module
define internal void @bar() {
    ret void
}

; CHECK: @anon.acbd18db4cc2f85cedef654fccc4a4d8.3 = global i8 0
; CHECK: @anon.acbd18db4cc2f85cedef654fccc4a4d8.4 = alias i8, ptr @anon.acbd18db4cc2f85cedef654fccc4a4d8.3
; CHECK: define void @anon.acbd18db4cc2f85cedef654fccc4a4d8.0()
; CHECK: define void @anon.acbd18db4cc2f85cedef654fccc4a4d8.1()
; CHECK: define void @anon.acbd18db4cc2f85cedef654fccc4a4d8.2()

define void @0() {
    ret void
}
define void @1() {
    ret void
}
define void @2() {
    ret void
}


@3 = global i8 0

@4 = alias i8, ptr @3