SCCP: Add failing testcase with llvm.ssa.copy
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 20 Dec 2022 16:34:06 +0000 (11:34 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 22 Dec 2022 22:14:38 +0000 (17:14 -0500)
llvm/test/Transforms/SCCP/issue59661-missing-predicate-info-for-ssa-copy.ll [new file with mode: 0644]

diff --git a/llvm/test/Transforms/SCCP/issue59661-missing-predicate-info-for-ssa-copy.ll b/llvm/test/Transforms/SCCP/issue59661-missing-predicate-info-for-ssa-copy.ll
new file mode 100644 (file)
index 0000000..564fe95
--- /dev/null
@@ -0,0 +1,21 @@
+; REQUIRES: asserts
+; XFAIL: *
+; RUN: opt -S -passes=ipsccp < %s
+
+; https://github.com/llvm/llvm-project/issues/59661
+
+define i32 @bar() {
+entry:
+  %call = call i32 @foo()
+  ret i32 0
+}
+
+define internal i32 @foo() {
+entry:
+  %arst = call ptr @llvm.ssa.copy.p0(ptr @foo)
+  ret i32 0
+}
+
+declare ptr @llvm.ssa.copy.p0(ptr) #0
+
+attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }