summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/const-init-cxx11.cpp
blob: 5ec9a690f9834ff247c114444ff09ea27fcb5511 (plain)
1
2
3
4
5
6
7
8
9
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s -std=c++11 | FileCheck %s

namespace CrossFuncLabelDiff {
  // Make sure we refuse to constant-fold the variable b.
  constexpr long a() { return (long)&&lbl + (0 && ({lbl: 0;})); }
  void test() { static long b = (long)&&lbl - a(); lbl: return; }
  // CHECK: sub nsw i64 ptrtoint (i8* blockaddress(@_ZN18CrossFuncLabelDiff4testEv, {{.*}}) to i64),
  // CHECK: store i64 {{.*}}, i64* @_ZZN18CrossFuncLabelDiff4testEvE1b, align 8
}
OpenPOWER on IntegriCloud