mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00

Summary: The name of the synthesized constants for constant initialization was using mangling for statics, which isn't generally correct and (in a yet-uncommitted patch) causes the mangler to assert out because the static ends up trying to mangle function parameters and this makes no sense. Instead, mangle to `"__const." + FunctionName + "." + DeclName`. Reviewers: rjmccall Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D54055 llvm-svn: 346915
11 lines
387 B
C++
11 lines
387 B
C++
// RUN: %clang_cc1 -std=c++2a -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s -w | FileCheck %s
|
|
|
|
// CHECK: @__const._Z1fv.arr = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
|
|
|
|
void f() {
|
|
// CHECK: %[[ARR:.*]] = alloca [3 x i32], align 4
|
|
// CHECK: call void @llvm.memcpy{{.*}}({{.*}} @__const._Z1fv.arr
|
|
for (int arr[3] = {1, 2, 3}; int a : arr)
|
|
;
|
|
}
|