Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / cxx2c-consteval-propagate.cpp
blobdf5191b29f75095e38f1a14da53c164120e854b7
1 // RUN: %clang_cc1 -emit-llvm %s -std=c++20 -triple x86_64-unknown-linux-gnu -o - | FileCheck %s
3 namespace GH63742 {
5 void side_effect();
6 consteval int f(int x) {
7 if (!__builtin_is_constant_evaluated()) side_effect();
8 return x;
10 struct SS {
11 int x = f(42);
12 SS();
14 SS::SS(){}
18 // CHECK-LABEL: @_ZN7GH637422SSC2Ev
19 // CHECK-NOT: call
20 // CHECK: store i32 42, ptr {{.*}}
21 // CHECK: ret void