]>
Commit | Line | Data |
---|---|---|
0324a497 PT |
1 | /* Test the fix for PR89841. */ |
2 | ||
3 | /* Contributed by Reinhold Bader <Bader@lrz.de> */ | |
4 | ||
527a1cf3 | 5 | #include <ISO_Fortran_binding.h> |
0324a497 PT |
6 | #include <stdio.h> |
7 | ||
8 | float Cxgl[] = { 1.1, 2.3, 5.1, 4.2 }; | |
9 | ||
10 | void globalp(CFI_cdesc_t *this) | |
11 | { | |
12 | int i, status; | |
13 | float *pt; | |
14 | CFI_index_t lb[] = { 3 }; | |
15 | CFI_index_t ub[] = { 6 }; | |
16 | ||
17 | if (this->base_addr == NULL) | |
18 | { | |
19 | status = CFI_allocate(this, lb, ub, 0); | |
20 | } | |
21 | else | |
22 | { | |
23 | printf("FAIL C: already allocated.\n"); | |
24 | return; | |
25 | } | |
26 | ||
27 | if (status != CFI_SUCCESS) | |
28 | { | |
29 | printf("FAIL C: status is %i\n",status); | |
30 | } | |
31 | ||
32 | pt = (float *) this->base_addr; | |
33 | for (i=0; i<4; i++) | |
34 | { | |
35 | pt[i] = Cxgl[i]; | |
36 | } | |
37 | } |