mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

"non-constant" value. If the constant evaluator evaluates part of a variable initializer, including the initializer for some lifetime-extended temporary, but fails to fully evaluate the initializer, it can leave behind wrong values for temporaries encountered in that initialization. Don't try to emit those from CodeGen! Instead, look at the values that constant evaluation produced if (and only if) it actually succeeds and we're emitting the lifetime-extending declaration's initializer as a constant. llvm-svn: 374119
19 lines
479 B
C++
19 lines
479 B
C++
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -std=c++2a | FileCheck %s
|
|
|
|
// CHECK-DAG: @p = {{.*}} null
|
|
// CHECK-DAG: @_ZGR1p_ = {{.*}} null
|
|
int *const &p = new int;
|
|
|
|
struct d {
|
|
constexpr d(int &&f) : e(f) {}
|
|
int &e;
|
|
};
|
|
|
|
// CHECK-DAG: @g = {{.*}} null
|
|
// CHECK-DAG: @_ZGR1g_ = {{.*}} zeroinitializer
|
|
d &&g{{0}};
|
|
|
|
// CHECK: define {{.*}} @__cxx_global_var_init
|
|
// CHECK: define {{.*}} @__cxx_global_var_init
|
|
// CHECK-NOT: define {{.*}} @__cxx_global_var_init
|