From a3b056a1f339bd7302e491c24757c195d823b60d Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Fri, 2 Feb 2024 23:39:36 +0530 Subject: [PATCH 1/2] TEST: Ported integration_tests/associate_03.f90 from LFortran --- integration_tests/pointer_02.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 integration_tests/pointer_02.cpp diff --git a/integration_tests/pointer_02.cpp b/integration_tests/pointer_02.cpp new file mode 100644 index 0000000..1d9d789 --- /dev/null +++ b/integration_tests/pointer_02.cpp @@ -0,0 +1,29 @@ +#include + +int main() { + + int* p1; + int t1 = 2, t2 = 1; + int i; + + std::cout << t1 << t2 << std::endl; + + if (t1 > t2) { + p1 = &t1; + } else { + p1 = &t2; + } + + std::cout << *p1 << std::endl; + + if (*p1 == t2) { + exit(2); + } + + i = *p1; + if (i == t2) { + exit(2); + } + + return 0; +} From 6b08b70a67a97982f81331c1ada4ffc410e98176 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Fri, 2 Feb 2024 23:39:49 +0530 Subject: [PATCH 2/2] TEST: Registered pointer_02.cpp --- integration_tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 52113fa..8e8fe27 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -214,5 +214,6 @@ RUN(NAME struct_03.cpp LABELS gcc llvm NOFAST) RUN(NAME struct_04.cpp LABELS gcc llvm NOFAST) RUN(NAME pointer_01.cpp LABELS gcc llvm NOFAST) +RUN(NAME pointer_02.cpp LABELS gcc llvm NOFAST) RUN(NAME function_01.cpp LABELS gcc llvm NOFAST)