Skip to content

Commit d0462c5

Browse files
committed
Add test case
1 parent 7debc6d commit d0462c5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; RUN: opt -passes=alignment-from-assumptions -disable-output < %s
2+
3+
; REQUIRES: asserts
4+
5+
; The alignment assumption is a global, which has users in a different
6+
; function. Test that in this case the dominator tree is only queried with
7+
; blocks from the same function.
8+
9+
target triple = "x86_64-unknown-linux-gnu"
10+
11+
@global = external constant [192 x i8]
12+
13+
define void @fn1() {
14+
call void @llvm.assume(i1 false) [ "align"(ptr @global, i64 1) ]
15+
ret void
16+
}
17+
18+
define void @fn2() {
19+
ret void
20+
21+
loop:
22+
%gep = getelementptr inbounds i8, ptr @global, i64 0
23+
%load = load i64, ptr %gep, align 1
24+
br label %loop
25+
}

0 commit comments

Comments
 (0)