aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/lto
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/lto')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_0.f9016
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_1.c14
2 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_0.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_0.f90
new file mode 100644
index 000000000..e12187985
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_0.f90
@@ -0,0 +1,16 @@
+! { dg-lto-do link }
+program test
+ use iso_fortran_env
+
+ interface
+ integer(int16) function bigendc16(x) bind(C)
+ import
+ integer(int16), intent(in) :: x
+ end function
+ end interface
+
+ integer(int16) :: x16 = 12345
+ x16 = bigendc16(x16)
+ print *,x16
+end program
+
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_1.c b/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_1.c
new file mode 100644
index 000000000..eddc569e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/lto/pr60635_1.c
@@ -0,0 +1,14 @@
+#include <stdint.h>
+#include <stdbool.h>
+
+static bool littleendian=true;
+
+uint16_t bigendc16(union{uint16_t * n;uint8_t* b;}x){
+
+ if (!littleendian) return *x.n;
+
+ uint16_t res = ((uint16_t)(x.b[1])<<0) |
+ ((uint16_t)(x.b[0])<<8);
+ return res;
+}
+