-
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.
selftests/bpf: add CO-RE relocs nesting tests
Add a bunch of test validating correct handling of nested structs/unions. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
- Loading branch information
Andrii Nakryiko
authored and
Alexei Starovoitov
committed
Aug 7, 2019
1 parent
002d3af
commit ec6438a
Showing
16 changed files
with
421 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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___anon_embed.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___anon_embed x) {} |
5 changes: 5 additions & 0 deletions
5
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___dup_compat_types.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,5 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f1(struct core_reloc_nesting___dup_compat_types x) {} | ||
void f2(struct core_reloc_nesting___dup_compat_types__2 x) {} | ||
void f3(struct core_reloc_nesting___dup_compat_types__3 x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_array_container.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_array_container x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_array_field.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_array_field x) {} |
4 changes: 4 additions & 0 deletions
4
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_dup_incompat_types.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,4 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f1(struct core_reloc_nesting___err_dup_incompat_types__1 x) {} | ||
void f2(struct core_reloc_nesting___err_dup_incompat_types__2 x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_missing_container.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_missing_container x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_missing_field.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_missing_field x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_nonstruct_container.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_nonstruct_container x) {} |
4 changes: 4 additions & 0 deletions
4
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_partial_match_dups.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,4 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f1(struct core_reloc_nesting___err_partial_match_dups__a x) {} | ||
void f2(struct core_reloc_nesting___err_partial_match_dups__b x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___err_too_deep.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___err_too_deep x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___extra_nesting.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___extra_nesting x) {} |
3 changes: 3 additions & 0 deletions
3
tools/testing/selftests/bpf/progs/btf__core_reloc_nesting___struct_union_mixup.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,3 @@ | ||
#include "core_reloc_types.h" | ||
|
||
void f(struct core_reloc_nesting___struct_union_mixup x) {} |
Oops, something went wrong.