aboutsummaryrefslogtreecommitdiffstats
path: root/test/Other
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-28 16:45:33 +0000
committerDan Gohman <gohman@apple.com>2010-05-28 16:45:33 +0000
commit17d95965cbf529f96277130b75c018f5f3873b66 (patch)
tree4e091349742dc848c12cb8be44fdd949a6299c64 /test/Other
parent34220aedc4242ab6a1356ca664a0f65c48d093f5 (diff)
downloadexternal_llvm-17d95965cbf529f96277130b75c018f5f3873b66.zip
external_llvm-17d95965cbf529f96277130b75c018f5f3873b66.tar.gz
external_llvm-17d95965cbf529f96277130b75c018f5f3873b66.tar.bz2
Detect self-referential values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rw-r--r--test/Other/lint.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Other/lint.ll b/test/Other/lint.ll
index 4cf9fd7..ea02d43 100644
--- a/test/Other/lint.ll
+++ b/test/Other/lint.ll
@@ -122,3 +122,14 @@ exit:
%t7 = inttoptr i64 %t6 to i32*
ret i32* %t7
}
+
+; CHECK: Undefined behavior: Undef pointer dereference
+define i32* @self_reference() {
+entry:
+ unreachable
+exit:
+ %t3 = phi i32* [ %t4, %exit ]
+ %t4 = bitcast i32* %t3 to i32*
+ %x = volatile load i32* %t3
+ br label %exit
+}