forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Add validation for Global Register Variable.
Fixes: llvm#76426
- Loading branch information
1 parent
72c901f
commit cda747d
Showing
2 changed files
with
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Check that -ffixed register handled for globals. | ||
// Regression test for #76426 | ||
// RUN: %clang --target=aarch64-none-gnu -ffixed-x15 -### %s 2>&1 | FileCheck %s | ||
// CHECK-NOT: fatal error: error in backend: Invalid register name "x15". | ||
|
||
register int i1 __asm__("x15"); | ||
|
||
int foo() { | ||
return i1; | ||
} | ||
int main() { | ||
return foo(); | ||
} |