================
@@ -247,9 +247,35 @@ size_type max_size(void) {
 // CIR:   %3 = cir.cast(integral, %2 : !s32i), !u64i
 // CIR:   %4 = cir.const #cir.int<8> : !u64i
 // CIR:   %5 = cir.binop(div, %3, %4) : !u64i
+// CIR:   cir.store %5, %0 : !u64i, !cir.ptr<!u64i>
+// CIR:   %6 = cir.load %0 : !cir.ptr<!u64i>, !u64i
+// CIR:   cir.return %6 : !u64i
+// CIR:   }
 
 // LLVM: define i64 @max_size()
 // LLVM:   store i64 2305843009213693951, ptr
 
 // OGCG: define{{.*}} i64 @max_size()
 // OGCG:   ret i64 2305843009213693951
+
+enum A {
+  A_one,
+  A_two
+};
+enum A a;
+
+// CIR:   cir.global external @a = #cir.int<0> : !u32i
+
+enum B : int;
+enum B b;
+
+// CIR:   cir.global external @b = #cir.int<0> : !s32i
+
+enum C : int {
+  C_one,
+  C_two
+};
+enum C c;
+
+// CIR:   cir.global external @c = #cir.int<0> : !s32i
+
----------------
mmha wrote:

Can you add a test that doesn't specify a fixed underlying type but uses a 
value that's out of range? for example

```c++
enum D {
  D_one = -1
};
```

https://github.com/llvm/llvm-project/pull/136807
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to