-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from czgdp1807/struct_03
Ported ``integration_tests/derived_types_13.f90`` from LFortran and improve LC to compile it
- Loading branch information
Showing
4 changed files
with
29 additions
and
1 deletion.
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
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,11 @@ | ||
#include <iostream> | ||
#include "struct_03_m_01.h" | ||
|
||
int main() { | ||
struct t x; | ||
x = new_value(); | ||
std::cout << x.i << std::endl; | ||
if (x.i != 123) { | ||
exit(2); | ||
} | ||
} |
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,14 @@ | ||
#ifndef INTEGRATION_TESTS_STRUCT_03_M_01_H | ||
#define INTEGRATION_TESTS_STRUCT_03_M_01_H | ||
|
||
struct t { | ||
int i; | ||
}; | ||
|
||
struct t new_value() { | ||
struct t p; | ||
p.i = 123; | ||
return p; | ||
} | ||
|
||
#endif |
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