-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some XFAILED testcase for poor code generation
- Loading branch information
1 parent
cf608f6
commit 28b9f7c
Showing
4 changed files
with
80 additions
and
6 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
28 changes: 28 additions & 0 deletions
28
llvm/test/CodeGen/Mips/cheri/bad-branch-delay-slot-usage-issue-290.c
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,28 @@ | ||
// RUN: %cheri_clang -S -o - -O2 %s -mllvm -debug-only="mips-delay-slot-filler" -mllvm -print-before="mips-delay-slot-filler" -mllvm -print-after="mips-delay-slot-filler" | FileCheck %s | ||
// REQUIRES: asserts | ||
// XFAIL: * | ||
// https://github.com/CTSRD-CHERI/llvm-project/issues/290 | ||
|
||
int *__capability test(int *__capability inCap, int test, int inInt) { | ||
int *__capability | ||
ret = inCap; | ||
if (test) { | ||
ret += inInt + 4; | ||
} | ||
return ret; | ||
} | ||
|
||
// CHECK-LABEL: # %bb.0: # %entry | ||
// CHECK-NEXT: daddiu $sp, $sp, -16 | ||
// CHECK-NEXT: sd $fp, 8($sp) # 8-byte Folded Spill | ||
// CHECK-NEXT: beqz $4, .LBB0_2 | ||
// CHECK-NEXT: move $fp, $sp | ||
// CHECK-NEXT: # %bb.1: # %if.then | ||
// CHECK-NEXT: addiu $1, $5, 4 | ||
// CHECK-NEXT: dsll $1, $1, 2 | ||
// CHECK-NEXT: cincoffset $c3, $c3, $1 | ||
// CHECK-NEXT: .LBB0_2: # %if.end | ||
// CHECK-NEXT: move $sp, $fp | ||
// CHECK-NEXT: ld $fp, 8($sp) # 8-byte Folded Reload | ||
// CHECK-NEXT: jr $ra | ||
// CHECK-NEXT: daddiu $sp, $sp, 16 |
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,39 @@ | ||
// RUN: %cheri_clang -v -S -o - -O2 %s -mllvm -print-before=cheriaddrmodefolder -mllvm -print-after=cheriaddrmodefolder | FileCheck %s | ||
// REQUIRES: asserts | ||
// XFAIL: * | ||
|
||
// https://github.com/CTSRD-CHERI/llvm-project/issues/292 | ||
|
||
// CHECK-LABEL doLoop: | ||
// CHECK-NEXT: daddiu $sp, $sp, -16 | ||
// CHECK-NEXT: sd $fp, 8($sp) # 8-byte Folded Spill | ||
// CHECK-NEXT: move $fp, $sp | ||
// CHECK-NEXT: cfromptr $1, $c1, $c0 | ||
// CHECK-NEXT: cfromptr $2, $c2, $c0 | ||
// CHECK-NEXT: clb $1, $6, 1($c1) | ||
// CHECK-NEXT: csb $1, $6, 1($c2) | ||
// CHECK-NEXT: clb $1, $6, 2($c1) | ||
// CHECK-NEXT: csb $1, $6, 2($c2) | ||
// CHECK-NEXT: move $sp, $fp | ||
// CHECK-NEXT: ld $fp, 8($sp) # 8-byte Folded Reload | ||
// CHECK-NEXT: jr $ra | ||
// CHECK-NEXT: daddiu $sp, $sp, 16 | ||
// CHECK-NEXT: | ||
|
||
void doLoop(char * in, char * out, int i) | ||
{ | ||
char * __capability inLocal = (__cheri_tocap char * __capability)in; | ||
char * __capability outLocal = (__cheri_tocap char * __capability)out; | ||
outLocal[i+1]=inLocal[i+1]; | ||
outLocal[i+2]=inLocal[i+2]; | ||
} | ||
|
||
void doLoop2(char * in, char * out, long i) | ||
{ | ||
char * __capability inLocal = (char * __capability)in; | ||
char * __capability outLocal = (char * __capability)out; | ||
do { | ||
outLocal[i]=inLocal[i]; | ||
i--; | ||
} while (i>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