1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 %s -emit-llvm -o - | FileCheck %s
4 // This code would previously cause a crash.
6 consteval
auto& X() { return x_
; }
7 constexpr auto& x1
= 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
16 // This code would previously cause a crash.
17 struct X
{ int val
; };
18 consteval X
g() { return {0}; }
21 // CHECK: define dso_local void @_ZN7PR514841fEv() #0 {
23 // CHECK-NOT: call i32 @_ZN7PR514841gEv()