diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtin-choose-expr-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-choose-expr-2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c b/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c new file mode 100644 index 000000000..d986b405f --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c @@ -0,0 +1,12 @@ +/* Test diagnostic for invalid use of __builtin_choose_expr. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +int a, b, c, d; + +void +f (void) +{ + a = __builtin_choose_expr (b, c, d); /* { dg-error "first argument to '__builtin_choose_expr' not a constant" } */ +} |