Detect self-referential values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104957 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-05-28 16:45:33 +00:00
parent 34220aedc4
commit 17d95965cb
2 changed files with 30 additions and 6 deletions

View File

@@ -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
}