-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][AArch64] Add validation for Global Register Variable. (#94271)
Fixes: #76426
- Loading branch information
1 parent
ede27d8
commit 5fe7f73
Showing
4 changed files
with
31 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,12 @@ | ||
// 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(); | ||
} |
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,4 @@ | ||
// RUN: %clang_cc1 -triple aarch64-unknown-none-gnu %s -verify -fsyntax-only | ||
|
||
register char i1 __asm__ ("x15"); // expected-error {{size of register 'x15' does not match variable size}} | ||
register long long l2 __asm__ ("w14"); // expected-error {{size of register 'w14' does not match variable size}} |