1 // RUN: %clang_cc1 -triple i386-mingw32 -fms-extensions -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
5 int isconst(void) __attribute__((const));
6 int ispure(int) __attribute__((pure
));
8 int foo(int *a
, int i
) {
11 __assume(++i
> 2); //expected-warning {{the argument to '__assume' has side effects that will be discarded}}
12 __assume(nonconst() > 2); //expected-warning {{the argument to '__assume' has side effects that will be discarded}}
13 __assume(isconst() > 2);
14 __assume(ispure(i
) > 2);
15 __assume(ispure(++i
) > 2); //expected-warning {{the argument to '__assume' has side effects that will be discarded}}
17 int test
= sizeof(struct{char qq
[(__assume(i
!= 5), 7)];});
19 __builtin_assume(i
!= 4);
20 __builtin_assume(++i
> 2); //expected-warning {{the argument to '__builtin_assume' has side effects that will be discarded}}
21 __builtin_assume(nonconst() > 2); //expected-warning {{the argument to '__builtin_assume' has side effects that will be discarded}}
22 __builtin_assume(isconst() > 2);
23 __builtin_assume(ispure(i
) > 2);
24 __builtin_assume(ispure(++i
) > 2); //expected-warning {{the argument to '__builtin_assume' has side effects that will be discarded}}
26 int test
= sizeof(struct{char qq
[(__builtin_assume(i
!= 5), 7)];}); // expected-warning {{variable length array}}