Skip to content

Commit 25aa241

Browse files
committed
TEST: Update reference tests
1 parent 5197896 commit 25aa241

32 files changed

+46
-344
lines changed

tests/reference/c-c_interop1-e215531.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-c_interop1-e215531.stdout",
9-
"stdout_hash": "3bc9bc474cda656a2012aad05b9bf9b9a498016da571f8e5a4857138",
9+
"stdout_hash": "11b48d84e0e873f5b2b5e8e92c721305af545a3a2b0038c2360d50e3",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-c_interop1-e215531.stdout

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,6 @@ void l(double a, float b, int64_t c, int32_t d)
5252
printf("%s\n", "OK");
5353
}
5454

55-
void main0()
56-
{
57-
double i;
58-
double x;
59-
float y;
60-
int64_t z;
61-
int32_t zz;
62-
x = 5.00000000000000000e+00;
63-
i = f(x);
64-
y = 5.40000000000000036e+00;
65-
z = 3;
66-
zz = 2;
67-
g(x, y, z, zz);
68-
i = h(x);
69-
l(x, y, z, zz);
70-
}
71-
7255
int main(int argc, char* argv[])
7356
{
7457
return 0;

tests/reference/cpp-assert1-ba60925.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-assert1-ba60925.stdout",
9-
"stdout_hash": "9fb92dc2310b01633d4a2de3d1378200d4de8ed88b880c54ac69c72e",
9+
"stdout_hash": "407c745929ee126426a33b3ba8f73b8f326d259e714ac66b078befe2",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-assert1-ba60925.stdout

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,10 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_assert();
2726
namespace {
2827
}
2928

3029
// Implementations
31-
void test_assert()
32-
{
33-
int32_t a;
34-
a = 5;
35-
assert (("a is not 5", a == 5));
36-
assert (a != 10);
37-
}
38-
3930
namespace {
4031

4132
void main2() {

tests/reference/cpp-expr2-09c05ad.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-expr2-09c05ad.stdout",
9-
"stdout_hash": "69ef58997a788c80db293cfeeffb14d1bb1a94f630fff4c8d11b235b",
9+
"stdout_hash": "407c745929ee126426a33b3ba8f73b8f326d259e714ac66b078befe2",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-expr2-09c05ad.stdout

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,10 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_boolOp();
2726
namespace {
2827
}
2928

3029
// Implementations
31-
void test_boolOp()
32-
{
33-
bool a;
34-
bool b;
35-
a = false;
36-
b = true;
37-
a = a && b;
38-
b = a || true;
39-
a = a || b;
40-
a = a && b == b;
41-
a = a && b != b;
42-
a = b || b;
43-
}
44-
4530
namespace {
4631

4732
void main2() {

tests/reference/cpp-expr5-1de0e30.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-expr5-1de0e30.stdout",
9-
"stdout_hash": "1f68a424d42810751fdd0169e4415cd9efcd4b7c5fb5932eddcf231c",
9+
"stdout_hash": "407c745929ee126426a33b3ba8f73b8f326d259e714ac66b078befe2",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-expr5-1de0e30.stdout

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,10 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_StrOp_concat();
2726
namespace {
2827
}
2928

3029
// Implementations
31-
void test_StrOp_concat()
32-
{
33-
std::string s;
34-
s = std::string("3") + std::string("4");
35-
s = std::string("a ") + std::string("test");
36-
s = std::string(std::string("test") + std::string("test")) + std::string("test");
37-
}
38-
3930
namespace {
4031

4132
void main2() {

tests/reference/cpp-expr6-f337f4f.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-expr6-f337f4f.stdout",
9-
"stdout_hash": "f804ce32ccbbaa39b2b00595c1a920caa64cd6edc786a3c4a11f4c50",
9+
"stdout_hash": "407c745929ee126426a33b3ba8f73b8f326d259e714ac66b078befe2",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-expr6-f337f4f.stdout

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,10 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_ifexp();
2726
namespace {
2827
}
2928

3029
// Implementations
31-
void test_ifexp()
32-
{
33-
int32_t a;
34-
int32_t b;
35-
bool c;
36-
a = 2;
37-
b = (a == 2) ? (6) : (8);
38-
c = (b > 5) ? (true) : (false);
39-
}
40-
4130
namespace {
4231

4332
void main2() {

tests/reference/cpp-expr8-704cece.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-expr8-704cece.stdout",
9-
"stdout_hash": "7b462e24b8799e255f9c12dd05f4fe8a15806e20277426c325c663cf",
9+
"stdout_hash": "0114926f9f033b9cbda860412fa9fadb1cebc84c57d89a6a6f6ce763",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-expr8-704cece.stdout

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,12 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_binop();
27-
bool __lpython_overloaded_6___lpython_floordiv(bool a, bool b);
2826
float _lfortran_caimag(std::complex<float> x);
2927
double _lfortran_zaimag(std::complex<double> x);
3028
namespace {
3129
}
3230

3331
// Implementations
34-
void test_binop()
35-
{
36-
bool b1;
37-
bool b2;
38-
int32_t x;
39-
float x2;
40-
x = std::pow(2, 3);
41-
x2 = std::pow( 2.00000000000000000e+00, 3.50000000000000000e+00);
42-
x = 54 - 100;
43-
x2 = 3.45400000000000018e+00 - 7.65429999999999950e+02 + 5.34600000000000023e+02;
44-
x2 = 5.34656499999999960e+03* 3.45000000000000018e+00;
45-
x2 = std::pow( 5.34656499999999960e+03, 3.45000000000000018e+00);
46-
x = (int)(true) + (int)(true);
47-
x = (int)(true) - (int)(false);
48-
x = (int)(true)*(int)(false);
49-
x = std::pow((int)(true), (int)(false));
50-
b1 = true;
51-
b2 = false;
52-
x = (int)(__lpython_overloaded_6___lpython_floordiv(b1, b1));
53-
x = std::pow((int)(b1), (int)(b2));
54-
}
55-
56-
bool __lpython_overloaded_6___lpython_floordiv(bool a, bool b)
57-
{
58-
bool _lpython_return_variable;
59-
if (b == false) {
60-
std::cerr << "ERROR STOP" << std::endl;
61-
exit(1);
62-
}
63-
_lpython_return_variable = a;
64-
return _lpython_return_variable;
65-
}
66-
6732
float _lfortran_caimag(std::complex<float> x);
6833

6934
double _lfortran_zaimag(std::complex<double> x);

tests/reference/cpp-loop3-6020091.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-loop3-6020091.stdout",
9-
"stdout_hash": "f98dcda4a54fd19d7580613adcee035efef61bc3aa675d881f6de934",
9+
"stdout_hash": "407c745929ee126426a33b3ba8f73b8f326d259e714ac66b078befe2",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-loop3-6020091.stdout

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,10 @@ struct dimension_descriptor
2323
int32_t lower_bound, length;
2424
};
2525
// Forward declarations
26-
void test_pass();
2726
namespace {
2827
}
2928

3029
// Implementations
31-
void test_pass()
32-
{
33-
int32_t a;
34-
a = 1;
35-
while (a > 0) {
36-
}
37-
}
38-
3930
namespace {
4031

4132
void main2() {

tests/reference/llvm-assert1-8df4f31.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "llvm-assert1-8df4f31.stdout",
9-
"stdout_hash": "548c0c52815267c5937b3877f09bb670683ce69013461d6bc9441cee",
9+
"stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-assert1-8df4f31.stdout

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
11
; ModuleID = 'LFortran'
22
source_filename = "LFortran"
33

4-
@0 = private unnamed_addr constant [20 x i8] c"AssertionError: %s\0A\00", align 1
5-
@1 = private unnamed_addr constant [11 x i8] c"a is not 5\00", align 1
6-
@2 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1
7-
8-
define void @test_assert() {
9-
.entry:
10-
%a = alloca i32, align 4
11-
store i32 5, i32* %a, align 4
12-
%0 = load i32, i32* %a, align 4
13-
%1 = icmp eq i32 %0, 5
14-
br i1 %1, label %then, label %else
15-
16-
then: ; preds = %.entry
17-
br label %ifcont
18-
19-
else: ; preds = %.entry
20-
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @0, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @1, i32 0, i32 0))
21-
call void @exit(i32 1)
22-
br label %ifcont
23-
24-
ifcont: ; preds = %else, %then
25-
%2 = load i32, i32* %a, align 4
26-
%3 = icmp ne i32 %2, 10
27-
br i1 %3, label %then1, label %else2
28-
29-
then1: ; preds = %ifcont
30-
br label %ifcont3
31-
32-
else2: ; preds = %ifcont
33-
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @2, i32 0, i32 0))
34-
call void @exit(i32 1)
35-
br label %ifcont3
36-
37-
ifcont3: ; preds = %else2, %then1
38-
br label %return
39-
40-
return: ; preds = %ifcont3
41-
ret void
42-
}
43-
44-
declare void @_lcompilers_print_error(i8*, ...)
45-
46-
declare void @exit(i32)
47-
484
define i32 @main(i32 %0, i8** %1) {
495
.entry:
506
call void @_lpython_set_argv(i32 %0, i8** %1)

tests/reference/llvm-expr14-b96b5b1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "llvm-expr14-b96b5b1.stdout",
9-
"stdout_hash": "1c7f09339ec9e1be7e8a01d8a7977cbd38e4d2fd17c736228ef860fe",
9+
"stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-expr14-b96b5b1.stdout

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
11
; ModuleID = 'LFortran'
22
source_filename = "LFortran"
33

4-
define void @test_boolean_comparison() {
5-
.entry:
6-
%b1 = alloca i1, align 1
7-
%b2 = alloca i1, align 1
8-
%b3 = alloca i1, align 1
9-
store i1 true, i1* %b1, align 1
10-
store i1 true, i1* %b2, align 1
11-
store i1 false, i1* %b3, align 1
12-
%0 = load i1, i1* %b1, align 1
13-
%1 = load i1, i1* %b2, align 1
14-
%2 = zext i1 %0 to i32
15-
%3 = zext i1 %1 to i32
16-
%4 = icmp ugt i32 %2, %3
17-
store i1 %4, i1* %b1, align 1
18-
%5 = load i1, i1* %b1, align 1
19-
%6 = load i1, i1* %b2, align 1
20-
%7 = zext i1 %5 to i32
21-
%8 = zext i1 %6 to i32
22-
%9 = icmp eq i32 %7, %8
23-
store i1 %9, i1* %b1, align 1
24-
%10 = load i1, i1* %b2, align 1
25-
%11 = load i1, i1* %b3, align 1
26-
%12 = zext i1 %10 to i32
27-
%13 = zext i1 %11 to i32
28-
%14 = icmp ne i32 %12, %13
29-
store i1 %14, i1* %b1, align 1
30-
%15 = load i1, i1* %b2, align 1
31-
%16 = load i1, i1* %b3, align 1
32-
%17 = zext i1 %15 to i32
33-
%18 = zext i1 %16 to i32
34-
%19 = icmp uge i32 %17, %18
35-
store i1 %19, i1* %b1, align 1
36-
%20 = load i1, i1* %b2, align 1
37-
%21 = load i1, i1* %b3, align 1
38-
%22 = zext i1 %20 to i32
39-
%23 = zext i1 %21 to i32
40-
%24 = icmp ule i32 %22, %23
41-
store i1 %24, i1* %b1, align 1
42-
br label %return
43-
44-
return: ; preds = %.entry
45-
ret void
46-
}
47-
484
define i32 @main(i32 %0, i8** %1) {
495
.entry:
506
call void @_lpython_set_argv(i32 %0, i8** %1)

tests/reference/llvm-lpython1-23c5987.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "llvm-lpython1-23c5987.stdout",
9-
"stdout_hash": "e159629de1a0c099150b091e961cc50a9388c3096ef63bc0d3aa12a1",
9+
"stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

0 commit comments

Comments
 (0)