Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IR] GetUnderlyingObject(), stripPointerCastsAndOffsets(): don't cras…
…h on `bitcast <1 x i8*> to i8*` I'm not sure how to write standalone tests for each of two changes here. If either one of these two fixes is missing, the test fill crash.
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 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
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
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,14 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: opt < %s -instsimplify -S | FileCheck %s | ||
|
||
target datalayout = "e-p:64:64:64-p1:16:16:16-p2:32:32:32-p3:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" | ||
|
||
declare void @usei8ptr(i8* %ptr) | ||
|
||
; Ensure that we do not crash when looking at such a weird bitcast. | ||
define i1 @bitcast_from_single_element_pointer_vector_to_pointer(<1 x i8*> %ptr1vec, i8* %ptr2) { | ||
%ptr1 = bitcast <1 x i8*> %ptr1vec to i8* | ||
call void @usei8ptr(i8* %ptr1) | ||
%cmp = icmp eq i8* %ptr1, %ptr2 | ||
ret i1 %cmp | ||
} |