Skip to content

Commit

Permalink
test: Add test for builtin types_compatible predicate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko authored and xlauko committed Sep 6, 2024
1 parent e71f377 commit 17a2408
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/vast/Dialect/HighLevel/types-compatible-a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t -

typedef int INT;
int main() {
// CHECK: hl.builtin_types_compatible_p.type !hl.int, !hl.char compatible false -> !hl.int
__builtin_types_compatible_p(int, char);
// CHECK: hl.builtin_types_compatible_p.type !hl.int, !hl.int compatible true -> !hl.int
__builtin_types_compatible_p(int, int);
// CHECK: hl.builtin_types_compatible_p.type !hl.int, !hl.elaborated<!hl.typedef<"INT">> compatible true -> !hl.int
__builtin_types_compatible_p(int, INT);
}

0 comments on commit 17a2408

Please sign in to comment.