static-mutable.cpp 319 B

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