-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let llvm-diff correctly deal with Undef/ConstantAggregateZero/Constan…
…tVector/IndirectBr Summary: llvm-diff incorrectly reports that there's a diff when input IR contains undef/zeroinitializer/constantvector/indirectbr. (This happens even if two identical files are given, e.g. `llvm-diff x.ll x.ll`) This is fix to the bug report https://bugs.llvm.org/show_bug.cgi?id=33623 . Reviewers: dexonsmith, rjmccall Reviewed By: rjmccall Subscribers: chenwj, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D34856 llvm-svn: 329957
- Loading branch information
Showing
5 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=33623 | ||
; RUN: llvm-diff %s %s | ||
|
||
%struct.it = type { i64, i64* } | ||
|
||
@a_vector = internal global [2 x i64] zeroinitializer, align 16 | ||
|
||
define i32 @foo(%struct.it* %it) { | ||
|
||
entry: | ||
%a = getelementptr inbounds %struct.it, %struct.it* %it, i64 0, i32 1 | ||
%tmp0 = bitcast i64** %a to <2 x i64*>* | ||
store <2 x i64*> <i64* getelementptr inbounds ([2 x i64], [2 x i64]* @a_vector, i64 0, i64 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @a_vector, i64 0, i64 0)>, <2 x i64*>* %tmp0, align 8 | ||
|
||
ret i32 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=33623 | ||
; RUN: llvm-diff %s %s | ||
|
||
define i32 @foo(i8*) { | ||
entry: | ||
indirectbr i8* %0, [label %A, label %B, label %entry] | ||
A: | ||
ret i32 1 | ||
B: | ||
ret i32 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=33623 | ||
; RUN: llvm-diff %s %s | ||
|
||
%A = type { i64, i64 } | ||
@_gm_ = global <2 x %A*> zeroinitializer | ||
|
||
define void @f() { | ||
entry: | ||
store <2 x %A*> undef, <2 x %A*>* @_gm_ | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=33623 | ||
; RUN: llvm-diff %s %s | ||
|
||
%A = type { i64, i64 } | ||
@_gm_ = global <2 x %A*> zeroinitializer | ||
|
||
define void @f() { | ||
entry: | ||
store <2 x %A*> zeroinitializer, <2 x %A*>* @_gm_ | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters