xref: /aosp_15_r20/external/clang/test/CodeGenCXX/static-mutable.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 %s -triple=i686-linux-gnu -emit-llvm -o - | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li struct S {
4*67e74705SXin Li   mutable int n;
5*67e74705SXin Li };
f()6*67e74705SXin Li int f() {
7*67e74705SXin Li   // The purpose of this test is to ensure that this variable is a global
8*67e74705SXin Li   // not a constant.
9*67e74705SXin Li   // CHECK: @_ZZ1fvE1s = internal global {{.*}} { i32 12 }
10*67e74705SXin Li   static const S s = { 12 };
11*67e74705SXin Li   return ++s.n;
12*67e74705SXin Li }
13