Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backends/graphs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2017 Barefoot Networks, Inc.

SPDX-License-Identifier: Apache-2.0
-->

<!--!
\page graphs_backend Graphs Backend
-->
Expand Down
4 changes: 4 additions & 0 deletions test/gtest/remove_dontcare_args_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
//
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>

#include "frontends/common/parseInput.h"
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_errors/issue1803_same_table_name.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2019 Barefoot Networks, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>
#include <v1model.p4>

Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_errors/issue4365_no_demote_error_to_info.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

// Ensure that errors cannot be demoted to info messages.
@command_line("--Winfo=type-error")
parser p() {
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_errors/issue4365_no_demote_error_to_warning.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

// Ensure that errors cannot be demoted to warnings.
@command_line("--Wwarn=type-error")
parser p() {
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_errors/issue4365_no_disable_error.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

// Ensure that errors cannot be disabled.
@command_line("--Wdisable=type-error")
parser p() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

control C();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
issue1803_same_table_name.p4(13): [--Wwarn=unused] warning: 'empty' is unused
issue1803_same_table_name.p4(19): [--Wwarn=unused] warning: 'empty' is unused
action empty() { }
^^^^^
[--Werror=duplicate] error: Name 't0' is used for multiple table objects in the P4Info message
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[--Werror=invalid] error: Error type-error cannot be demoted.
Use '--help' to see all available options.
issue4365_no_demote_error_to_info.p4(4): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
issue4365_no_demote_error_to_info.p4(10): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
state accept {
^^^^^^
issue4365_no_demote_error_to_info.p4(3): [--Werror=invalid] error: Parser p has no 'start' state
issue4365_no_demote_error_to_info.p4(9): [--Werror=invalid] error: Parser p has no 'start' state
parser p() {
^
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[--Werror=invalid] error: Error type-error cannot be demoted.
Use '--help' to see all available options.
issue4365_no_demote_error_to_warning.p4(4): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
issue4365_no_demote_error_to_warning.p4(10): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
state accept {
^^^^^^
issue4365_no_demote_error_to_warning.p4(3): [--Werror=invalid] error: Parser p has no 'start' state
issue4365_no_demote_error_to_warning.p4(9): [--Werror=invalid] error: Parser p has no 'start' state
parser p() {
^
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[--Werror=invalid] error: Error type-error cannot be demoted.
Use '--help' to see all available options.
issue4365_no_disable_error.p4(4): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
issue4365_no_disable_error.p4(10): [--Werror=invalid] error: Invalid parser state: accept should not be implemented, it is built-in
state accept {
^^^^^^
issue4365_no_disable_error.p4(3): [--Werror=invalid] error: Parser p has no 'start' state
issue4365_no_disable_error.p4(9): [--Werror=invalid] error: Parser p has no 'start' state
parser p() {
^
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
issue5254_dup_switch_case_label_error.p4(34): [--Werror=invalid] error: 8s1: duplicate case label 8s1
issue5254_dup_switch_case_label_error.p4(40): [--Werror=invalid] error: 8s1: duplicate case label 8s1
(int<8>)1: {}
^
issue5254_dup_switch_case_label_error.p4(33)
issue5254_dup_switch_case_label_error.p4(39)
(int<8>)1: {}
^
issue5254_dup_switch_case_label_error.p4(40): [--Werror=invalid] error: 8w1: duplicate case label 8w1
issue5254_dup_switch_case_label_error.p4(46): [--Werror=invalid] error: 8w1: duplicate case label 8w1
(bit<8>)1: {}
^
issue5254_dup_switch_case_label_error.p4(39)
issue5254_dup_switch_case_label_error.p4(45)
(bit<8>)1: {}
^
issue5254_dup_switch_case_label_error.p4(46): [--Werror=invalid] error: error.Error1: duplicate case label error.Error1
issue5254_dup_switch_case_label_error.p4(52): [--Werror=invalid] error: error.Error1: duplicate case label error.Error1
error.Error1: {}
^^^^^^^^^^^^
issue5254_dup_switch_case_label_error.p4(45)
issue5254_dup_switch_case_label_error.p4(51)
error.Error1: {}
^^^^^^^^^^^^
issue5254_dup_switch_case_label_error.p4(52): [--Werror=invalid] error: e.e1: duplicate case label e.e1
issue5254_dup_switch_case_label_error.p4(58): [--Werror=invalid] error: e.e1: duplicate case label e.e1
e.e1: {}
^^^^
issue5254_dup_switch_case_label_error.p4(51)
issue5254_dup_switch_case_label_error.p4(57)
e.e1: {}
^^^^
issue5254_dup_switch_case_label_error.p4(58): [--Werror=invalid] error: s.s1: duplicate case label s.s1
issue5254_dup_switch_case_label_error.p4(64): [--Werror=invalid] error: s.s1: duplicate case label s.s1
s.s1: {}
^^^^
issue5254_dup_switch_case_label_error.p4(57)
issue5254_dup_switch_case_label_error.p4(63)
s.s1: {}
^^^^
issue5254_dup_switch_case_label_error.p4(70): [--Werror=invalid] error: a: duplicate case label a
issue5254_dup_switch_case_label_error.p4(76): [--Werror=invalid] error: a: duplicate case label a
a: {}
^
issue5254_dup_switch_case_label_error.p4(69)
issue5254_dup_switch_case_label_error.p4(75)
a: {}
^
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/action_selector_unused-bmv2.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2017 Barefoot Networks, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>
#include <v1model.p4>

Expand Down
4 changes: 4 additions & 0 deletions testdata/p4_16_samples/constant-in-calculation-bmv2.stf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2017 Barefoot Networks, Inc.
#
# SPDX-License-Identifier: Apache-2.0

# bit<16> A
# In the output we need A = 1

Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/invalid_header_default_action_arg.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2026 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

header h_t { bit<8> f; }
header_union hu_t { h_t h1; h_t h2; }
control C() {
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue3699.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

const bit<4> one = 1;
const bit<4> max = 0xf;
const bit<4> value = max |+| one;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

// Expect no errors, as --Wdisable should take precedence over --Werror for warnings.
@command_line("--Werror", "--Wdisable=uninitialized-use", "--Wdisable=invalid-header")
header h_t {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

// Control testcase to ensure that this program actually emits warnings
// that can be disabled with --Wdisable=uninitialized-use and --Wdisable=invalid-header.
header h_t {
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue4507_1.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

extern void __e(in bit<28> arg);
extern void __e2(in bit<28> arg);

Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue4507_2.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

extern void __e(in bit<28> arg);
extern void __e2(in bit<28> arg);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

header h_t {
bit<8> f;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

header h_t {
bit<8> f;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

extern void foo();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

header h_t {
bit<((10 == 1 ? 1 : 10 + 1) * (8+1))> f;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

extern void foo();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

extern void foo();
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue4760_dontcare_action_out_arg.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

struct S {
bit<64> f;
}
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue4883_dup_has_returned_decl.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

struct S {
Expand Down
6 changes: 6 additions & 0 deletions testdata/p4_16_samples/issue4883_dup_has_returned_decl2.p4
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

struct S {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

parser Parser1() {
bit<8> l = 0;
state start {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

parser Parser1() {
bit<8> l = 0;
state start {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2024 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

parser Parser1() {
bit<8> l = 0;
state start {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core.p4>

struct S {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

control C(out bit<64> v64) {
action a() {
v64 = (bit<64>)(int<64>)(int<1>)1w1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

control C(out bit<64> v64) {
action a2(in bit<1> value) {
v64 = (bit<64>)(int<64>)(int<1>)value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

extern void __e(in bit<4> x);
control C() {
action a() {
Expand Down
Loading
Loading