Skip to content

Commit

Permalink
test:conv: Add test for lowering of static local.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Sep 25, 2024
1 parent d452285 commit 46554b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/vast/Conversion/static-var-a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %vast-front -vast-emit-mlir=hl -o - %s | %file-check %s -check-prefix=HL
// RUN: %check-evict-static-locals %s | %file-check %s -check-prefix=EVICTED
// RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=LLVM

// HL: hl.var @x sc_static
// HL: hl.ref @x

// EVICTED: hl.var @foo.x {context = 0 : i64}, <internal> sc_static
// EVICTED: ll.func @foo
// EVICTED: hl.ref @foo.x

// LLVM: llvm.mlir.global internal @foo.x()
// LLVM: llvm.func @foo
// LLVM: llvm.mlir.addressof @foo.x
int foo() {
static int x = 5;
return x++;
}

0 comments on commit 46554b5

Please sign in to comment.