-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix externalization in command line macros, IBT tests
This commit fixes a weird case where the SymbolExternalizer attempts to rewrite a macro that was defined in the command line. This also fixes the first IBT testcase, as well as add new ones that are currently failing so we mark them as XFAIL. linux tests are now in testsuite/linux. Signed-off-by: Giuliano Belinassi <[email protected]>
- Loading branch information
1 parent
459bb1d
commit e4c5381
Showing
9 changed files
with
79 additions
and
23 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
File renamed without changes.
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,19 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_SYMVERS_PATH=../testsuite/linux/Modules.symvers -DCE_RENAME_SYMBOLS -nostdinc -I../testsuite/linux -DKBUILD_MODNAME=crc32c -D__USE_IBT__ -D__KERNEL__ -DCE_KEEP_INCLUDES" } */ | ||
|
||
typedef unsigned int u32; | ||
|
||
u32 crc32c(u32 crc, const void *address, unsigned int length); | ||
|
||
int f(void) | ||
{ | ||
u32 lcrc = 0; | ||
void *addr = 0; | ||
unsigned int len = 0; | ||
|
||
(void)crc32c(lcrc, addr, len); | ||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "u32 klpe_crc32c|u32 \(klpe_crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump "KLP_RELOC_SYMBOL\(crc32c, libcrc32c, crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump-not "\(\*klpe_crc32c\)" } } */ |
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,23 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_SYMVERS_PATH=../testsuite/linux/Modules.symvers -DCE_RENAME_SYMBOLS -nostdinc -I../testsuite/linux -DKBUILD_MODNAME=crc32c -D__USE_IBT__ -D__KERNEL__ -DCE_KEEP_INCLUDES" } */ | ||
|
||
/* Check why the include is not being output. */ | ||
/* { dg-xfail }*/ | ||
|
||
typedef unsigned int u32; | ||
|
||
u32 crc32c(u32 crc, const void *address, unsigned int length); | ||
|
||
int f(void) | ||
{ | ||
u32 lcrc = 0; | ||
void *addr = 0; | ||
unsigned int len = 0; | ||
|
||
(void)crc32c(lcrc, addr, len); | ||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "#include <linux/livepatch.h>" } } */ | ||
/* { dg-final { scan-tree-dump "u32 klpe_crc32c|u32 \(klpe_crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump "KLP_RELOC_SYMBOL\(crc32c, libcrc32c, crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump-not "\(\*klpe_crc32c\)" } } */ |
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,22 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_SYMVERS_PATH=../testsuite/linux/Modules.symvers -DCE_RENAME_SYMBOLS -nostdinc -I../testsuite/linux -DKBUILD_MODNAME=crc32c -D__USE_IBT__ -D__KERNEL__ -DCE_KEEP_INCLUDES" } */ | ||
/* { dg-xfail } */ | ||
|
||
/* Check why parenthesis are being output in the redeclaration. */ | ||
|
||
typedef unsigned int u32; | ||
|
||
u32 crc32c(u32 crc, const void *address, unsigned int length); | ||
|
||
int f(void) | ||
{ | ||
u32 lcrc = 0; | ||
void *addr = 0; | ||
unsigned int len = 0; | ||
|
||
(void)crc32c(lcrc, addr, len); | ||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "u32 klpe_crc32c" } } */ | ||
/* { dg-final { scan-tree-dump "KLP_RELOC_SYMBOL\(crc32c, libcrc32c, crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump-not "\(\*klpe_crc32c\)" } } */ |
File renamed without changes.
Empty file.
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 was deleted.
Oops, something went wrong.