aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/JS/global-alias.ll
blob: b6efc0e7e7ae96826f6dc429b7c848046d469c1a (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
; RUN: llc -march=js < %s | FileCheck %s

; Handle global aliases of various kinds.

@pri = internal global [60 x i8] zeroinitializer
@pub = global [60 x i8] zeroinitializer

@pri_int = alias internal [60 x i8]* @pri
@pri_wea = alias weak [60 x i8]* @pri
@pri_nor = alias [60 x i8]* @pri

@pub_int = alias internal [60 x i8]* @pub
@pub_wea = alias weak [60 x i8]* @pub
@pub_nor = alias [60 x i8]* @pub

; CHECK: test0(
; CHECK: return ([[PRI:[0-9]+]]|0);
define [60 x i8]* @test0() {
  ret [60 x i8]* @pri
}
; CHECK: test1(
; CHECK: return ([[PRI]]|0);
define [60 x i8]* @test1() {
  ret [60 x i8]* @pri_int
}
; CHECK: test2(
; CHECK: return ([[PRI]]|0);
define [60 x i8]* @test2() {
  ret [60 x i8]* @pri_wea
}
; CHECK: test3(
; CHECK: return ([[PRI]]|0);
define [60 x i8]* @test3() {
  ret [60 x i8]* @pri_nor
}

; CHECK: test4(
; CHECK: return ([[PUB:[0-9]+]]|0);
define [60 x i8]* @test4() {
  ret [60 x i8]* @pub
}
; CHECK: test5(
; CHECK: return ([[PUB]]|0);
define [60 x i8]* @test5() {
  ret [60 x i8]* @pub_int
}
; CHECK: test6(
; CHECK: return ([[PUB]]|0);
define [60 x i8]* @test6() {
  ret [60 x i8]* @pub_wea
}
; CHECK: test7(
; CHECK: return ([[PUB]]|0);
define [60 x i8]* @test7() {
  ret [60 x i8]* @pub_nor
}