Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gcc.target / nios2 / custom-fp-cmp-1.c
blobb290c41e4755cd031cb3fe1dd8b05c6c0a35287b
1 /* Test generation of floating-point compare custom instructions. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
6 /* -O1 in the options is significant. Without it FP operations may not be
7 optimized to custom instructions. */
9 #pragma GCC target ("custom-frdxhi=40")
10 #pragma GCC target ("custom-frdxlo=41")
11 #pragma GCC target ("custom-frdy=42")
12 #pragma GCC target ("custom-fwrx=43")
13 #pragma GCC target ("custom-fwry=44")
15 #pragma GCC target ("custom-fcmpeqs=200")
17 int
18 test_fcmpeqs (float a, float b)
20 return (a == b);
23 /* { dg-final { scan-assembler "custom\\t200, .* # fcmpeqs .*" } } */
25 #pragma GCC target ("custom-fcmpgtd=201")
27 int
28 test_fcmpgtd (double a, double b)
30 return (a > b);
33 /* { dg-final { scan-assembler "custom\\t201, .* # fcmpgtd .*" } } */
35 #pragma GCC target ("custom-fcmples=202")
37 int
38 test_fcmples (float a, float b)
40 return (a <= b);
43 /* { dg-final { scan-assembler "custom\\t202, .* # fcmples .*" } } */
45 #pragma GCC target ("custom-fcmpned=203")
47 int
48 test_fcmpned (double a, double b)
50 return (a != b);
53 /* { dg-final { scan-assembler "custom\\t203, .* # fcmpned .*" } } */