File: test_iso_c_binding_constants.f90

package info (click to toggle)
lfortran 0.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 46,332 kB
  • sloc: cpp: 137,068; f90: 51,260; python: 6,444; ansic: 4,277; yacc: 2,285; fortran: 806; sh: 524; makefile: 30; javascript: 15
file content (60 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
program test_iso_c_binding_constants
   use iso_c_binding

   print *, c_int8_t
   if (c_int8_t /= 1) error stop

   print *, c_int16_t
   if (c_int16_t /= 2) error stop

   print *, c_int32_t
   if (c_int32_t /= 4) error stop

   print *, c_int64_t
   if (c_int64_t /= 8) error stop

   print *, c_int
   if (c_int /= 4) error stop

   print *, c_short
   if (c_short /= 2) error stop

   print *, c_long
   if (c_long /= 8) error stop

   print *, c_long_long
   if (c_long_long /= 8) error stop

   print *, c_size_t
   if (c_size_t /= 8) error stop

   print *, c_float
   if (c_float /= 4) error stop

   print *, c_double
   if (c_double /= 8) error stop

   ! Currently unsupported
   ! print *, c_long_double
   ! if (c_long_double /= 10) error stop

   print *, c_float_complex
   if (c_float_complex /= 4) error stop

   print *, c_double_complex
   if (c_double_complex /= 8) error stop

   ! Currently unsupported
   ! print *, c_long_double_complex
   ! if (c_long_double_complex /= 10) error stop

   print *, c_bool
   if (c_bool /= 1) error stop

   print *, c_char
   if (c_char /= 1) error stop

   print *, c_null_char
   if (c_null_char /= char(0)) error stop
   
end program test_iso_c_binding_constants