-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
408 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/golden/test_metaprogramming/test_quote_complex_expr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, int32_t* a ) { | ||
*a = *a + ((int32_t) 1) + ((int32_t) 1); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM, | ||
// b : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, const int32_t* a, int32_t* b ) { | ||
*b = *a; | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/golden/test_metaprogramming/test_scope_collision1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, int32_t* a ) { | ||
int32_t b; | ||
b = ((int32_t) 2); | ||
*a = ((int32_t) 1); | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
tests/golden/test_metaprogramming/test_scope_collision2.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM, | ||
// b : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, const int32_t* a, int32_t* b ) { | ||
*b = *a; | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
tests/golden/test_metaprogramming/test_statement_assignment.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, int32_t* a ) { | ||
*a += ((int32_t) 1); | ||
*a += ((int32_t) 2); | ||
*a += ((int32_t) 1); | ||
*a += ((int32_t) 2); | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/golden/test_metaprogramming/test_type_quote_elision.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i8 @DRAM, | ||
// x : i8[2] @DRAM | ||
// ) | ||
void foo( void *ctxt, int8_t* a, const int8_t* x ) { | ||
*a += x[0]; | ||
*a += x[1]; | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/golden/test_metaprogramming/test_unquote_elision.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// foo( | ||
// a : i32 @DRAM | ||
// ) | ||
void foo( void *ctxt, int32_t* a ) { | ||
*a = *a * ((int32_t) 2); | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
tests/golden/test_metaprogramming/test_unquote_in_slice.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// bar( | ||
// a : i8[10, 10] @DRAM | ||
// ) | ||
void bar( void *ctxt, int8_t* a ) { | ||
for (int_fast32_t i = 0; i < 5; i++) { | ||
foo(ctxt,(struct exo_win_1i8){ &a[(i) * (10) + 2], { 1 } }); | ||
} | ||
} | ||
|
||
// foo( | ||
// a : [i8][2] @DRAM | ||
// ) | ||
void foo( void *ctxt, struct exo_win_1i8 a ) { | ||
a.data[0] += a.data[a.strides[0]]; | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
tests/golden/test_metaprogramming/test_unquote_index_tuple.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// bar( | ||
// a : i8[10, 10, 10] @DRAM | ||
// ) | ||
void bar( void *ctxt, int8_t* a ) { | ||
for (int_fast32_t i = 0; i < 7; i++) { | ||
foo(ctxt,(struct exo_win_2i8){ &a[(i) * (100) + (i) * (10) + i + 1], { 10, 1 } }); | ||
} | ||
} | ||
|
||
// foo( | ||
// a : [i8][2, 2] @DRAM | ||
// ) | ||
void foo( void *ctxt, struct exo_win_2i8 a ) { | ||
a.data[0] += a.data[a.strides[1]]; | ||
a.data[a.strides[0]] += a.data[a.strides[0] + a.strides[1]]; | ||
} | ||
|
31 changes: 31 additions & 0 deletions
31
tests/golden/test_metaprogramming/test_unquote_slice_object1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "test.h" | ||
|
||
|
||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
|
||
// bar( | ||
// a : i8[10, 10] @DRAM | ||
// ) | ||
void bar( void *ctxt, int8_t* a ) { | ||
for (int_fast32_t i = 0; i < 10; i++) { | ||
foo(ctxt,(struct exo_win_1i8){ &a[(i) * (10) + 1], { 1 } }); | ||
} | ||
for (int_fast32_t i = 0; i < 10; i++) { | ||
foo(ctxt,(struct exo_win_1i8){ &a[(i) * (10) + 5], { 1 } }); | ||
} | ||
for (int_fast32_t i = 0; i < 10; i++) { | ||
foo(ctxt,(struct exo_win_1i8){ &a[(i) * (10) + 2], { 1 } }); | ||
} | ||
} | ||
|
||
// foo( | ||
// a : [i8][2] @DRAM | ||
// ) | ||
void foo( void *ctxt, struct exo_win_1i8 a ) { | ||
a.data[0] += a.data[a.strides[0]]; | ||
} | ||
|
Oops, something went wrong.