Skip to content

Commit

Permalink
pr: Add SARIF test.
Browse files Browse the repository at this point in the history
  • Loading branch information
frabert committed Nov 21, 2024
1 parent 647be83 commit 49b2e72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parsers/rle-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -vast-emit-mlir=hl %s -o - | %file-check %s -check-prefix=HL
// RUN: %vast-front -vast-show-locs -vast-loc-attrs -vast-emit-mlir=hl %s -o - | %detect-parsers -vast-hl-to-parser -parser-source-to-sarif=output=/dev/stdout out.mlir -o /dev/null | %file-check %s -check-prefix=SARIF

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -38,10 +39,14 @@ void parse_binary_file(const char *filename) {

// Read header (4 bytes) - contains length of compressed data
uint32_t compressed_length;
// SARIF: "startColumn": 5
// SARIF: "startLine": 43
fread(&compressed_length, sizeof(uint32_t), 1, file);

// Allocate memory for compressed data
uint8_t *compressed_data = (uint8_t *)malloc(compressed_length);
// SARIF: "startColumn": 5
// SARIF: "startLine": 49
fread(compressed_data, sizeof(uint8_t), compressed_length, file);

// Close the file after reading
Expand Down

0 comments on commit 49b2e72

Please sign in to comment.