diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-07-21 21:56:00 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-07-21 21:56:00 +0000 |
| commit | e9fc79bb13e833644548416f5aece0571f8c175d (patch) | |
| tree | 1a39c712fa82f497e5f60e60611b785610a0b141 /llvm/test/Transforms | |
| parent | b8d2873d93c1e40d99fae9c25505246f3815c0d7 (diff) | |
| download | bcm5719-llvm-e9fc79bb13e833644548416f5aece0571f8c175d.tar.gz bcm5719-llvm-e9fc79bb13e833644548416f5aece0571f8c175d.zip | |
[InstSimplify] don't crash handling a pointer or aggregate type
llvm-svn: 276345
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/select.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll index eafab250b62..6ddaaba2046 100644 --- a/llvm/test/Transforms/InstSimplify/select.ll +++ b/llvm/test/Transforms/InstSimplify/select.ll @@ -389,3 +389,16 @@ define i64 @select_icmp_x_and_8_ne_0_y64_and_not_8(i32 %x, i64 %y) { ret i64 %and1.y } +; Don't crash on a pointer or aggregate type. + +define i32* @select_icmp_pointers(i32* %x, i32* %y) { +; CHECK-LABEL: @select_icmp_pointers( +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32* %x, null +; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32* %x, i32* %y +; CHECK-NEXT: ret i32* [[SEL]] +; + %cmp = icmp slt i32* %x, null + %sel = select i1 %cmp, i32* %x, i32* %y + ret i32* %sel +} + |

