1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=alias --implicit-check-not=Alias
5 @fa = alias void (), ptr @f
6 ; CHECK: Alias must point to a definition
9 @g = external global i32
10 @ga = alias i32, ptr @g
11 ; CHECK: Alias must point to a definition
14 define available_externally void @f2() {
17 @fa2 = alias void(), ptr @f2
18 ; CHECK: Alias must point to a definition
21 @test2_a = alias i32, ptr @test2_b
22 @test2_b = alias i32, ptr @test2_a
23 ; CHECK: Aliases cannot form a cycle
24 ; CHECK-NEXT: ptr @test2_a
25 ; CHECK-NEXT: Aliases cannot form a cycle
26 ; CHECK-NEXT: ptr @test2_b
29 @test3_a = global i32 42
30 @test3_b = weak alias i32, ptr @test3_a
31 @test3_c = alias i32, ptr @test3_b
32 ; CHECK: Alias cannot point to an interposable alias
33 ; CHECK-NEXT: ptr @test3_c
35 @test4_a = available_externally global i32 42
36 @test4_b = available_externally alias i32, ptr @test4_a
37 @test4_c = available_externally alias void(), ptr @f2
38 @test4_d = available_externally alias i32, ptr @test4_b
40 @test4_e = available_externally alias i32, ptr @test3_a
41 @test4_f = available_externally alias i32, inttoptr (i64 sub (i64 ptrtoint (ptr @test4_a to i64), i64 ptrtoint (ptr @test4_a to i64)) to ptr)
42 ; CHECK: available_externally alias must point to available_externally global value
43 ; CHECK-NEXT: ptr @test4_e
44 ; CHECK: available_externally alias must point to available_externally global value
45 ; CHECK-NEXT: ptr @test4_f