summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/iftrap-2.c
blob: 8c9c0577ca508b472fb431153eefe5b9f68ea469 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Verify that we optimize to conditional traps.  */
/* { dg-options "-O" } */
/* { dg-do compile { target rs6000-*-* powerpc*-*-* sparc*-*-* ia64-*-* } } */
/* { dg-final { scan-assembler-not "^\t(trap|ta|break)\[ \t\]" } } */

extern void abort(void);

void f1(int p)
{
  if (p)
    __builtin_trap();
  else
    abort();
}

void f2(int p)
{
  if (p)
    abort();
  else
    __builtin_trap();
}