[clang][bytecode] Support pointers in __builtin_mem{move,cpy} (#120560)
[llvm-project.git] / clang / test / Parser / cxx23-assume.cpp
blob269fb7e599443e188b6e285cea9bfadf38cb8e0a
1 // RUN: %clang_cc1 -std=c++23 -x c++ %s -verify
3 void f(int x, int y) {
4 [[assume(true)]];
5 [[assume(1)]];
6 [[assume(1.0)]];
7 [[assume(1 + 2 == 3)]];
8 [[assume(x ? 1 : 2)]];
9 [[assume(x && y)]];
10 [[assume(true)]] [[assume(true)]];
12 [[assume]]; // expected-error {{takes one argument}}
13 [[assume(]]; // expected-error {{expected expression}}
14 [[assume()]]; // expected-error {{expected expression}}
15 [[assume(2]]; // expected-error {{expected ')'}} expected-note {{to match this '('}}
16 [[assume(x = 2)]]; // expected-error {{requires parentheses}}
17 [[assume(2, 3)]]; // expected-error {{requires parentheses}} expected-warning {{has no effect}}