Skip to content

Commit 6b545c2

Browse files
committed
[Attributor] Add pre-commit tests
1 parent e8e75e0 commit 6b545c2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -S -passes=attributor < %s | FileCheck %s
3+
4+
5+
6+
define internal i1 @foo(ptr %dst) {
7+
entry:
8+
store i32 42, ptr %dst
9+
ret i1 true
10+
}
11+
12+
13+
define i1 @fee(i32 %x, i32 %y) {
14+
%ptr = alloca i32
15+
%a = call i1 @foo(ptr %ptr, i32 %y)
16+
%b = load i32, ptr %ptr
17+
%c = icmp sle i32 %b, %x
18+
%xor = xor i1 %a, %c
19+
ret i1 %xor
20+
}

0 commit comments

Comments
 (0)