]> git.ipfire.org Git - people/ms/u-boot.git/blame - post/lib_powerpc/fpu/20001122-1.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / post / lib_powerpc / fpu / 20001122-1.c
CommitLineData
b4489621
SP
1/*
2 * Copyright (C) 2007
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
b4489621
SP
6 */
7/*
8 * This file is originally a part of the GCC testsuite.
9 */
10
11#include <common.h>
12
b4489621
SP
13#include <post.h>
14
ce82ff05
YT
15GNU_FPOST_ATTR
16
e009cdeb
KG
17#if CONFIG_POST & CONFIG_SYS_POST_FPU
18
b4489621
SP
19int fpu_post_test_math1 (void)
20{
944416e0 21 volatile double a;
b4489621
SP
22 double c, d;
23 volatile double b;
24
25 d = 1.0;
b4489621
SP
26
27 do
28 {
29 c = d;
30 d = c * 0.5;
31 b = 1 + d;
32 } while (b != 1.0);
33
34 a = 1.0 + c;
35
36 if (a == 1.0) {
37 post_log ("Error in FPU math1 test\n");
38 return -1;
39 }
40
41 return 0;
42}
43
6d0f6bcf 44#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */