[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / cxx20-consteval-crash.cpp
blob19f02c4cf41d06d34159ae0271e3fb529dd8b30b
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 %s -emit-llvm -o - | FileCheck %s
3 namespace PR50787 {
4 // This code would previously cause a crash.
5 extern int x_;
6 consteval auto& X() { return x_; }
7 constexpr auto& x1 = X();
8 auto x2 = X();
10 // CHECK: @_ZN7PR507872x_E = external global i32, align 4
11 // CHECK-NEXT: @_ZN7PR507872x1E = constant i32* @_ZN7PR507872x_E, align 8
12 // CHECK-NEXT: @_ZN7PR507872x2E = global i32* @_ZN7PR507872x_E, align 4
15 namespace PR51484 {
16 // This code would previously cause a crash.
17 struct X { int val; };
18 consteval X g() { return {0}; }
19 void f() { g(); }
21 // CHECK: define dso_local void @_ZN7PR514841fEv() #0 {
22 // CHECK: entry:
23 // CHECK-NOT: call i32 @_ZN7PR514841gEv()
24 // CHECK: ret void
25 // CHECK: }