Fix verifier for GlobalAliases to avoid recursing into global initializers.
[oota-llvm.git] / test / Verifier / alias.ll
1 ; RUN:  not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
2
3
4 declare void @f()
5 @fa = alias void ()* @f
6 ; CHECK: Alias must point to a definition
7 ; CHECK-NEXT: @fa
8
9 @g = external global i32
10 @ga = alias i32* @g
11 ; CHECK: Alias must point to a definition
12 ; CHECK-NEXT: @ga
13
14 ; References to a global declaration from an initializer are OK.
15 @gptr = global i32* @g
16 @gptr_a = alias i32** @gptr
17 ; CHECK-NOT: Alias must point to a definition
18
19 @test2_a = alias i32* @test2_b
20 @test2_b = alias i32* @test2_a
21 ; CHECK:      Aliases cannot form a cycle
22 ; CHECK-NEXT: i32* @test2_a
23 ; CHECK-NEXT: Aliases cannot form a cycle
24 ; CHECK-NEXT: i32* @test2_b
25
26
27 @test3_a = global i32 42
28 @test3_b = alias weak i32* @test3_a
29 @test3_c = alias i32* @test3_b
30 ; CHECK: Alias cannot point to a weak alias
31 ; CHECK-NEXT: i32* @test3_c