-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86-64] Only check if DestReg is not null if it is read from
[Test] Add test to verify the change.
- Loading branch information
1 parent
8698fcc
commit 91c5bfa
Showing
2 changed files
with
62 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// REQUIRES: x86_64-linux | ||
// RUN: clang -O0 -o %t %s | ||
// RUN: llvm-mctoll -d -I /usr/include/stdio.h %t | ||
// RUN: clang -o %t-dis %t-dis.ll | ||
// RUN: %t-dis 2>&1 | FileCheck %s | ||
// CHECK: 4 | ||
// CHECK-EMPTY | ||
|
||
.text | ||
.intel_syntax noprefix | ||
.file "raise-xor-ri.s" | ||
|
||
|
||
.globl main # -- Begin function main | ||
.p2align 4, 0x90 | ||
.type main,@function | ||
main: # @main | ||
sub rsp, 4 | ||
mov dword ptr [rsp], 2 | ||
# destination register is a register with an undefined value | ||
imul eax, dword ptr [rsp], 2 | ||
mov esi, eax | ||
movabs rdi, offset .L.str | ||
mov al, 0 | ||
call printf | ||
|
||
add rsp, 4 | ||
mov eax, 0 | ||
ret | ||
|
||
.type .L.str,@object # @.str | ||
.section .rodata.str1.1,"aMS",@progbits,1 | ||
.L.str: | ||
.asciz "%d\n" | ||
.size .L.str, 4 |