Andy Kaylor b415db02e7
[CIR] Add handlers for 'using enum' and namespace alias (#148011)
These decl types don't require any code generation, though when debug
info is implemented, we will need to add handling for that. Until then,
we just need to have a handler so they don't generate an NYI error.
2025-07-10 16:16:37 -07:00

28 lines
452 B
C++

// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck %s --input-file=%t.cir
enum Numbers {
Zero,
One,
Two,
Three
};
int f() {
return Numbers::One;
}
// CHECK: cir.func{{.*}} @_Z1fv
// CHECK: cir.const #cir.int<1> : !u32i
namespace test {
using enum Numbers;
};
int f2() {
return test::Two;
}
// CHECK: cir.func{{.*}} @_Z2f2v
// CHECK: cir.const #cir.int<2> : !u32i