2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / cmn-neg2.c
blobca45a53435f9cbdbd160f3133af1bcc73329f952
1 /* { dg-do run } */
2 /* { dg-options "-O2 --save-temps" } */
4 extern void abort (void);
6 /* It's unsafe to use CMN in these comparisons. */
8 void __attribute__ ((noinline))
9 foo_s32 (int a, int b)
11 if (a < -b)
12 abort ();
15 void __attribute__ ((noinline))
16 foo_s64 (unsigned long long a, unsigned long long b)
18 if (a > -b)
19 abort ();
23 int
24 main (void)
26 int a = 30;
27 int b = 42;
28 foo_s32 (a, b);
29 foo_s64 (a, b);
30 return 0;
32 /* { dg-final { scan-assembler-not "cmn\t" } } */
34 /* { dg-final { cleanup-saved-temps } } */