// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-error=underlying-atomic-qualifier-ignored -std=c23 %s -emit-llvm -o - | FileCheck %s

// Ensure that an "atomic" underlying type has no actual atomic semantics
// because the qualifier is stripped.

enum E : _Atomic(int) {
  Foo
};

// CHECK-LABEL: define {{.*}} void @test(
// CHECK-SAME: i32 noundef [[E:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[E_ADDR:%.*]] = alloca i32
// CHECK-NEXT:    [[X:%.*]] = alloca i32
// CHECK-NEXT:    store i32 [[E]], ptr [[E_ADDR]]
// CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[E_ADDR]]
// CHECK-NEXT:    store i32 [[TMP0]], ptr [[X]]
// CHECK-NEXT:    store i32 0, ptr [[E_ADDR]]
// CHECK-NEXT:    ret void
//
void test(enum E e) {
  int x = e;
  e = Foo;
}

