[llvm] a011823 - [GlobalOpt] Add test where the initializer evaluation fails.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 07:02:02 PST 2023
Author: Florian Hahn
Date: 2023-03-10T16:01:47+01:00
New Revision: a011823bff4d5399fd9ca6718aeb902d509b8887
URL: https://github.com/llvm/llvm-project/commit/a011823bff4d5399fd9ca6718aeb902d509b8887
DIFF: https://github.com/llvm/llvm-project/commit/a011823bff4d5399fd9ca6718aeb902d509b8887.diff
LOG: [GlobalOpt] Add test where the initializer evaluation fails.
Test coverage for D145490.
Added:
llvm/test/Transforms/GlobalOpt/load-failed-to-evaluate-initializer.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/GlobalOpt/load-failed-to-evaluate-initializer.ll b/llvm/test/Transforms/GlobalOpt/load-failed-to-evaluate-initializer.ll
new file mode 100644
index 000000000000..9ceac10ad765
--- /dev/null
+++ b/llvm/test/Transforms/GlobalOpt/load-failed-to-evaluate-initializer.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; RUN: opt -passes=globalopt -S -debug %s 2>&1 | FileCheck %s
+
+; REQUIRES: asserts
+
+ at g = internal global { double } { double 0x40E7606FBE1650A4 }
+
+; CHECK: Global SRA: Failed to evaluate initializer of @g =
+
+define [1 x double] @test () {
+; CHECK-LABEL: define [1 x double] @test() local_unnamed_addr {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[L:%.*]] = load [1 x double], ptr @g, align 8
+; CHECK-NEXT: ret [1 x double] [[L]]
+;
+entry:
+ %l = load [1 x double], ptr @g, align 8
+ ret [1 x double] %l
+}
More information about the llvm-commits
mailing list