aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/027.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-04 18:53:25 +0900
committernsfisis <nsfisis@gmail.com>2025-05-04 18:56:46 +0900
commit25be5bff61866ded6362dfdc966ae67ea27da984 (patch)
treed38481a9c7e95b9e6c44f132e37a673e888d1954 /tests/027.sh
parent72a19908d4f0c1aad46bd38ce6926dd60b9247e3 (diff)
downloadP4Dcc-25be5bff61866ded6362dfdc966ae67ea27da984.tar.gz
P4Dcc-25be5bff61866ded6362dfdc966ae67ea27da984.tar.zst
P4Dcc-25be5bff61866ded6362dfdc966ae67ea27da984.zip
struct decl/def
Diffstat (limited to 'tests/027.sh')
-rw-r--r--tests/027.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/027.sh b/tests/027.sh
new file mode 100644
index 0000000..ee10aa3
--- /dev/null
+++ b/tests/027.sh
@@ -0,0 +1,72 @@
+set -e
+
+cat <<'EOF' > expected
+EOF
+bash ../../test_diff.sh <<'EOF'
+struct Token {
+ int kind;
+ char* value;
+};
+
+struct Define {
+ char* from;
+ struct Token* to;
+};
+
+struct AstNode;
+
+struct Type {
+ int kind;
+ struct Type* to;
+ struct AstNode* members;
+};
+
+struct AstNode {
+ int kind;
+ struct AstNode* next;
+ struct AstNode* last;
+ char* name;
+ struct AstNode* func_params;
+ struct AstNode* func_body;
+ int int_value;
+ struct AstNode* expr1;
+ struct AstNode* expr2;
+ struct AstNode* expr3;
+ int op;
+ struct Type* ty;
+ int var_index;
+ struct AstNode* node1;
+ struct AstNode* node2;
+ char** str_literals;
+};
+
+struct LVar {
+ char* name;
+ struct Type* ty;
+};
+
+struct Func {
+ char* name;
+ struct Type* ty;
+};
+
+struct Parser {
+ struct Token* tokens;
+ int pos;
+ struct LVar* locals;
+ int n_locals;
+ struct Func* funcs;
+ int n_funcs;
+ char** str_literals;
+ int n_str_literals;
+};
+
+struct CodeGen {
+ int next_label;
+ int* loop_labels;
+};
+
+int main() {
+ return 0;
+}
+EOF