[llvm] bd80dbf - [test] Precommit test for D145210
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 3 11:24:55 PST 2023
Author: Arthur Eubanks
Date: 2023-03-03T11:22:32-08:00
New Revision: bd80dbf284c685db3427a169386d150398b5151d
URL: https://github.com/llvm/llvm-project/commit/bd80dbf284c685db3427a169386d150398b5151d
DIFF: https://github.com/llvm/llvm-project/commit/bd80dbf284c685db3427a169386d150398b5151d.diff
LOG: [test] Precommit test for D145210
Added:
llvm/test/Transforms/PhaseOrdering/func-attrs.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/PhaseOrdering/func-attrs.ll b/llvm/test/Transforms/PhaseOrdering/func-attrs.ll
new file mode 100644
index 000000000000..64b33e794ed8
--- /dev/null
+++ b/llvm/test/Transforms/PhaseOrdering/func-attrs.ll
@@ -0,0 +1,33 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
+; RUN: opt -O2 -S < %s | FileCheck %s
+
+declare void @g()
+
+define internal i32 @h1(i32 %a, i32 %b) {
+ %c = add i32 %a, %b
+ %c2 = add i32 2, %c
+ ret i32 %c2
+}
+
+define internal i32 @h2(i32 %a, i32 %b) {
+ %c = add i32 %a, %b
+ %c2 = add i32 2, %c
+ ret i32 %c2
+}
+
+define void @f(i32 %a, i32 %b) noinline {
+; CHECK: Function Attrs: noinline
+; CHECK-LABEL: @f(
+; CHECK-NEXT: end:
+; CHECK-NEXT: ret void
+;
+ %c = call i32 @h1(i32 %a, i32 %b)
+ %d = call i32 @h2(i32 %a, i32 %b)
+ %i = icmp eq i32 %c, %d
+ br i1 %i, label %end, label %dead
+dead:
+ call void @g()
+ br label %end
+end:
+ ret void
+}
More information about the llvm-commits
mailing list