diff --git a/tests/fortran/cubes.f b/tests/fortran/cubes.f new file mode 100644 index 0000000..55226db --- /dev/null +++ b/tests/fortran/cubes.f @@ -0,0 +1,15 @@ +cc34567 Cubes program + PROGRAM SUM_OF_CUBES + INTEGER :: H, T, U + ! This program prints all 3-digit numbers that + ! equal the sum of the cubes of their digits. + DO H = 1, 9 + DO T = 0, 9 + DO U = 0, 9 + IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN + PRINT "(3I1)", H, T, U + ENDIF + END DO + END DO + END DO + END PROGRAM SUM_OF_CUBES diff --git a/tests/fortran/cubes.hand-inst.f b/tests/fortran/cubes.hand-inst.f new file mode 100644 index 0000000..e553c7a --- /dev/null +++ b/tests/fortran/cubes.hand-inst.f @@ -0,0 +1,22 @@ +cc34567 Cubes program + PROGRAM SUM_OF_CUBES + integer profiler(2) / 0, 0 / + save profiler + INTEGER :: H, T, U + call TAU_PROFILE_INIT() + call TAU_PROFILE_TIMER(profiler, 'PROGRAM SUM_OF_CUBES') + call TAU_PROFILE_START(profiler) + call TAU_PROFILE_SET_NODE(0) + ! This program prints all 3-digit numbers that + ! equal the sum of the cubes of their digits. + DO H = 1, 9 + DO T = 0, 9 + DO U = 0, 9 + IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN + PRINT "(3I1)", H, T, U + ENDIF + END DO + END DO + END DO + call TAU_PROFILE_STOP(profiler) + END PROGRAM SUM_OF_CUBES diff --git a/tests/hello.f90 b/tests/fortran/hello.f90 similarity index 100% rename from tests/hello.f90 rename to tests/fortran/hello.f90 diff --git a/tests/fortran/loop_test.f90 b/tests/fortran/loop_test.f90 new file mode 100644 index 0000000..647e103 --- /dev/null +++ b/tests/fortran/loop_test.f90 @@ -0,0 +1,33 @@ +subroutine bar(arg) + integer arg + + print *, "inside bar arg = ", arg +end subroutine bar + +subroutine foo(iVal) + integer iVal + integer j, k +! Do something here... + print *, "Iteration = ", iVal + do j = 1, 5 + do k = 1, 2 + print *, "j = ", j + end do + end do + + do 10, i = 1, 3 + call bar(i+iVal) +10 continue + print *, "after calling bar in foo" + end + +program main + integer i + + print *, "test program" + + do 10, i = 1, 3 + call foo(i) +10 continue +end program main +