Skip to content

Commit

Permalink
test: Add tests for macroqualified and count_attributed types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Nov 4, 2024
1 parent 3cd8907 commit c3926b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/vast/Dialect/HighLevel/counted_by-a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// RUN: %vast-front -vast-emit-mlir=hl %s -o - | %file-check %s
// RUN: %vast-front -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t -
struct bar;

struct foo {
unsigned int count;
char other;
// CHECK: hl.field @array : !hl.count_attributed<CountedBy, !hl.array<{{.*}}>
struct bar *array[] __attribute__((counted_by(count)));
};

5 changes: 5 additions & 0 deletions test/vast/Dialect/HighLevel/macro_qualified-a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %vast-front -vast-emit-mlir=hl %s -o - | %file-check %s
// RUN: %vast-front -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t -
#define CDECL __attribute__((cdecl))
// CHECK: !hl.ptr<!hl.macro_qualified<{{.*}}>>
typedef void (CDECL *X)();

0 comments on commit c3926b1

Please sign in to comment.