Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
29 changes: 29 additions & 0 deletions integration_tests/pointer_02.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <iostream>

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;
}