Debian Codegraph @

gcc/testsuite/gfortran.dg/lto/bind_c-3_0.f90

raw
1 ! { dg-lto-do run }
2 ! { dg-lto-options {{ -O3 -flto }} }
3 ! This testcase will abort if integer types are not interoperable.
4 module lto_type_merge_test
5 use, intrinsic :: iso_c_binding
6 implicit none
7
8 type, bind(c) :: MYFTYPE_1
9 integer(c_int) :: val_int
10 integer(c_short) :: val_short
11 integer(c_long) :: val_long
12 integer(c_long_long) :: val_long_long
13 integer(c_size_t) :: val_size_t
14 integer(c_int8_t) :: val_int8_t
15 integer(c_int16_t) :: val_int16_t
16 integer(c_int32_t) :: val_int32_t
17 integer(c_int64_t) :: val_int64_t
18 integer(c_int_least8_t) :: val_intleast_8_t
19 integer(c_int_least16_t) :: val_intleast_16_t
20 integer(c_int_least32_t) :: val_intleast_32_t
21 integer(c_int_least64_t) :: val_intleast_64_t
22 integer(c_int_fast8_t) :: val_intfast_8_t
23 integer(c_int_fast16_t) :: val_intfast_16_t
24 integer(c_int_fast32_t) :: val_intfast_32_t
25 integer(c_int_fast64_t) :: val_intfast_64_t
26 integer(c_intmax_t) :: val_intmax_t
27 integer(c_intptr_t) :: val_intptr_t
28 end type MYFTYPE_1
29
30 type(myftype_1), bind(c, name="myVar") :: myVar
31
32 contains
33 subroutine types_test1() bind(c)
34 myVar%val_int = 2
35 end subroutine types_test1
36 subroutine types_test2() bind(c)
37 myVar%val_short = 2
38 end subroutine types_test2
39 subroutine types_test3() bind(c)
40 myVar%val_long = 2
41 end subroutine types_test3
42 subroutine types_test4() bind(c)
43 myVar%val_long_long = 2
44 end subroutine types_test4
45 subroutine types_test5() bind(c)
46 myVar%val_size_t = 2
47 end subroutine types_test5
48 subroutine types_test6() bind(c)
49 myVar%val_int8_t = 2
50 end subroutine types_test6
51 subroutine types_test7() bind(c)
52 myVar%val_int16_t = 2
53 end subroutine types_test7
54 subroutine types_test8() bind(c)
55 myVar%val_int32_t = 2
56 end subroutine types_test8
57 subroutine types_test9() bind(c)
58 myVar%val_int64_t = 2
59 end subroutine types_test9
60 subroutine types_test10() bind(c)
61 myVar%val_intleast_8_t = 2
62 end subroutine types_test10
63 subroutine types_test11() bind(c)
64 myVar%val_intleast_16_t = 2
65 end subroutine types_test11
66 subroutine types_test12() bind(c)
67 myVar%val_intleast_32_t = 2
68 end subroutine types_test12
69 subroutine types_test13() bind(c)
70 myVar%val_intleast_64_t = 2
71 end subroutine types_test13
72 subroutine types_test14() bind(c)
73 myVar%val_intfast_8_t = 2
74 end subroutine types_test14
75 subroutine types_test15() bind(c)
76 myVar%val_intfast_16_t = 2
77 end subroutine types_test15
78 subroutine types_test16() bind(c)
79 myVar%val_intfast_32_t = 2
80 end subroutine types_test16
81 subroutine types_test17() bind(c)
82 myVar%val_intfast_64_t = 2
83 end subroutine types_test17
84 subroutine types_test18() bind(c)
85 myVar%val_intmax_t = 2
86 end subroutine types_test18
87 subroutine types_test19() bind(c)
88 myVar%val_intptr_t = 2
89 end subroutine types_test19
90 end module lto_type_merge_test
91