Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TEST: Update reference tests
  • Loading branch information
ubaidsk committed Nov 16, 2023
commit a0dc512c27af3cdb7360e8e5d6d87240e1d702c6
2 changes: 1 addition & 1 deletion tests/reference/c-expr_12-93c7780.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "c-expr_12-93c7780.stdout",
"stdout_hash": "4cbfe2f301edb2e5df13058ec0ff1415277851ee8ffcdda264b2f239",
"stdout_hash": "95d8b9361a2cc1334d3e79c77eee2d79f266cd5cdff2d824faacfa9d",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
19 changes: 11 additions & 8 deletions tests/reference/c-expr_12-93c7780.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

struct dimension_descriptor
{
int32_t lower_bound, length;
int32_t lower_bound, length, stride;
};

struct i16
{
int16_t *data;
struct dimension_descriptor dims[32];
int32_t n_dims;
int32_t offset;
bool is_allocated;
};

Expand All @@ -30,16 +31,16 @@ void __main__global_stmts();
// Implementations
void g(struct i16* *x, struct i16* y)
{
y->data[(0 - y->dims[0].lower_bound)] = 1;
y->data[(1 - y->dims[0].lower_bound)] = 2;
y->data[((0 + (y->dims[0].stride * (0 - y->dims[0].lower_bound))) + y->offset)] = 1;
y->data[((0 + (y->dims[0].stride * (1 - y->dims[0].lower_bound))) + y->offset)] = 2;
(*x) = y;
printf("%d%s%d\n", (*x)->data[(0 - (*x)->dims[0].lower_bound)], " ", (*x)->data[(1 - (*x)->dims[0].lower_bound)]);
printf("%d%s%d\n", (*x)->data[((0 + ((*x)->dims[0].stride * (0 - (*x)->dims[0].lower_bound))) + (*x)->offset)], " ", (*x)->data[((0 + ((*x)->dims[0].stride * (1 - (*x)->dims[0].lower_bound))) + (*x)->offset)]);
}

void check(struct i16* *ptr)
{
ASSERT((*ptr)->data[(0 - (*ptr)->dims[0].lower_bound)] == 1);
ASSERT((*ptr)->data[(1 - (*ptr)->dims[0].lower_bound)] == 2);
ASSERT((*ptr)->data[((0 + ((*ptr)->dims[0].stride * (0 - (*ptr)->dims[0].lower_bound))) + (*ptr)->offset)] == 1);
ASSERT((*ptr)->data[((0 + ((*ptr)->dims[0].stride * (1 - (*ptr)->dims[0].lower_bound))) + (*ptr)->offset)] == 2);
}

void f()
Expand All @@ -49,12 +50,14 @@ void f()
int16_t y_data[2];
y->data = y_data;
y->n_dims = 1;
y->offset = 0;
y->dims[0].lower_bound = 0;
y->dims[0].length = 2;
y->dims[0].stride = 1;
struct i16 yptr1_value;
struct i16* yptr1 = &yptr1_value;
g(&yptr1, y);
check(&yptr1);
g(yptr1, y);
check(yptr1);
}

void __main__global_stmts()
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/cpp-doconcurrentloop_01-4e9f274.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "cpp-doconcurrentloop_01-4e9f274.stdout",
"stdout_hash": "cef4c9a2fa79bd4f12c0842cc4cae9d0be7f1891b5c66ee6b229bb9f",
"stdout_hash": "8a4d62895106f08dea98f98b2bae7c3f27b6b324243e47df681eba3c",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Kokkos::View<T*> from_std_vector(const std::vector<T> &v)

struct dimension_descriptor
{
int32_t lower_bound, length;
int32_t lower_bound, length, stride;
};

struct f32_10000_1
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/cpp-test_list_repeat2-698d7f4.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "cpp-test_list_repeat2-698d7f4.stdout",
"stdout_hash": "b3979f6c5ea575cbbb0ae75fe566f811f6bb92aca2e698e6d0564326",
"stdout_hash": "6e6428a71e48dbad6de969a48a9b958be8fb6d5ec2ed8490ee3f72ff",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/cpp-test_list_repeat2-698d7f4.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Kokkos::View<T*> from_std_vector(const std::vector<T> &v)

struct dimension_descriptor
{
int32_t lower_bound, length;
int32_t lower_bound, length, stride;
};

struct list_r32 {
Expand Down