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:53:45 +0100
commit4285e856aa073979bf046168a75188ccf5a1e7d4 (patch)
tree1a146b3d4545cfd683e4d71588060d917af24a06 /meta/lib/oeqa/runtime/files
parent06d6f9d52e9cb636d007f35db38819eebf1f4000 (diff)
downloadpoky-4285e856aa073979bf046168a75188ccf5a1e7d4.tar.gz
lib/oeqa/runtime: add gcc test
gcc compile test and support files. (From OE-Core rev: ccbce75335971abf5098a492755e92ca60cf67bd) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@
1#include <stdio.h>
2#include <math.h>
3#include <stdlib.h>
4
5double convert(long long l)
6{
7 return (double)l;
8}
9
10int main(int argc, char * argv[]) {
11
12 long long l = 10;
13 double f;
14 double check = 10.0;
15
16 f = convert(l);
17 printf("convert: %lld => %f\n", l, f);
18 if ( f != check ) exit(1);
19
20 f = 1234.67;
21 check = 1234.0;
22 printf("floorf(%f) = %f\n", f, floorf(f));
23 if ( floorf(f) != check) exit(1);
24
25 return 0;
26}
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 @@
1test: test.o
2 gcc -o test test.o -lm
3test.o: test.c
4 gcc -c test.c
5