summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/files
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-06-28 11:55:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-09 10:49:20 +0100
commitccbce75335971abf5098a492755e92ca60cf67bd (patch)
treeb47260dc570b0805109c9e2533dde41c214ab286 /meta/lib/oeqa/runtime/files
parentdd3dc2804395f050df74fa936e65ce5e911442eb (diff)
downloadopenembedded-core-contrib-ccbce75335971abf5098a492755e92ca60cf67bd.tar.gz
lib/oeqa/runtime: add gcc test
gcc compile test and support files. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Diffstat (limited to 'meta/lib/oeqa/runtime/files')
-rw-r--r--meta/lib/oeqa/runtime/files/test.c26
-rw-r--r--meta/lib/oeqa/runtime/files/testmakefile5
2 files changed, 31 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/files/test.c b/meta/lib/oeqa/runtime/files/test.c
new file mode 100644
index 0000000000..2d8389c92e
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/test.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+double convert(long long l)
+{
+ return (double)l;
+}
+
+int main(int argc, char * argv[]) {
+
+ long long l = 10;
+ double f;
+ double check = 10.0;
+
+ f = convert(l);
+ printf("convert: %lld => %f\n", l, f);
+ if ( f != check ) exit(1);
+
+ f = 1234.67;
+ check = 1234.0;
+ printf("floorf(%f) = %f\n", f, floorf(f));
+ if ( floorf(f) != check) exit(1);
+
+ return 0;
+}
diff --git a/meta/lib/oeqa/runtime/files/testmakefile b/meta/lib/oeqa/runtime/files/testmakefile
new file mode 100644
index 0000000000..ca1844e930
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/testmakefile
@@ -0,0 +1,5 @@
+test: test.o
+ gcc -o test test.o -lm
+test.o: test.c
+ gcc -c test.c
+