[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / ptrauth-sign-constant.cpp
blob396962e33e2fa9cc9b970fddee36a4f6fdf8a16f
1 // RUN: %clang_cc1 -triple arm64-apple-ios -std=c++17 -Wno-vla -fsyntax-only -verify -fptrauth-intrinsics %s
2 // RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++17 -Wno-vla -fsyntax-only -verify -fptrauth-intrinsics %s
4 int n;
5 constexpr bool compare_result = __builtin_ptrauth_sign_constant(&n, 2, 0) == &n;
6 // expected-error@-1 {{constant expression}}
7 // expected-note@-2 {{comparison against opaque constant address '&__builtin_ptrauth_sign_constant(&n, 2, 0)'}}