Skip to content

Commit c45c6af

Browse files
committed
test: Add parser conversion test to expr-a
1 parent 7877322 commit c45c6af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/parsers/expr-a.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// RUN: %vast-front -vast-emit-mlir=hl %s -o - | %file-check %s -check-prefix=HL
2+
// RUN: %vast-front -vast-show-locs -vast-loc-attrs -vast-emit-mlir=hl %s -o - | %vast-opt -vast-hl-to-lazy-regions -o %t.mlir
3+
// RUN: %vast-detect-parsers -vast-hl-to-parser -vast-parser-reconcile-casts -reconcile-unrealized-casts %t.mlir -o - | %file-check %s -check-prefix=PARSER
24

35
#include <stdio.h>
46
#include <ctype.h>
57

68
// HL: hl.func @parse_number
9+
// PARSER: hl.func @parse_number
710
int parse_number(const char **input) {
811
int value = 0;
912
while (isdigit(**input)) {
@@ -14,6 +17,7 @@ int parse_number(const char **input) {
1417
}
1518

1619
// HL: hl.func @add_two_numbers
20+
// PARSER: hl.func @add_two_numbers
1721
int add_two_numbers(const char *input) {
1822
int num1 = parse_number(&input);
1923
while (isspace(*input)) input++; // Skip spaces

0 commit comments

Comments
 (0)