(no commit message)
authorlkcl <lkcl@web>
Wed, 26 Apr 2023 15:17:30 +0000 (16:17 +0100)
committerIkiWiki <ikiwiki.info>
Wed, 26 Apr 2023 15:17:30 +0000 (16:17 +0100)
openpower/sv/cookbook/fortran__95__maxloc.mdwn [new file with mode: 0644]

diff --git a/openpower/sv/cookbook/fortran__95__maxloc.mdwn b/openpower/sv/cookbook/fortran__95__maxloc.mdwn
new file mode 100644 (file)
index 0000000..2cee8b6
--- /dev/null
@@ -0,0 +1,21 @@
+<https://bugs.libre-soc.org/show_bug.cgi?id=676>
+
+```
+int m2(int * const restrict a, int n) 
+{ 
+   int m, nm; 
+   int i; 
+
+   m = INT_MIN; 
+   nm = -1; 
+   for (i=0; i<n; i++) 
+   { 
+       if (a[i] > m) 
+       { 
+           m = a[i]; 
+           nm = i; 
+       } 
+    } 
+    return nm; 
+}
+```