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