diff options
author | Manoj Gupta <manojgupta@google.com> | 2018-04-05 15:29:52 +0000 |
---|---|---|
committer | Manoj Gupta <manojgupta@google.com> | 2018-04-05 15:29:52 +0000 |
commit | 4b3eefa5e84484da29cd95df8c7c0946a07bc98a (patch) | |
tree | b9b9adaa2d1faaf6a833980e332eff530cebca32 /clang/test/CodeGen/array-init.c | |
parent | bbf98aea83f725f59afcb5bdb4c4dec0b3a0f587 (diff) | |
download | bcm5719-llvm-4b3eefa5e84484da29cd95df8c7c0946a07bc98a.tar.gz bcm5719-llvm-4b3eefa5e84484da29cd95df8c7c0946a07bc98a.zip |
Disable -fmerge-all-constants as default.
Summary:
"-fmerge-all-constants" is a non-conforming optimization and should not
be the default. It is also causing miscompiles when building Linux
Kernel (https://lkml.org/lkml/2018/3/20/872).
Fixes PR18538.
Reviewers: rjmccall, rsmith, chandlerc
Reviewed By: rsmith, chandlerc
Subscribers: srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D45289
llvm-svn: 329300
Diffstat (limited to 'clang/test/CodeGen/array-init.c')
-rw-r--r-- | clang/test/CodeGen/array-init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/test/CodeGen/array-init.c b/clang/test/CodeGen/array-init.c index fa54994acc3..62e87edc297 100644 --- a/clang/test/CodeGen/array-init.c +++ b/clang/test/CodeGen/array-init.c @@ -1,8 +1,11 @@ -// RUN: %clang_cc1 %s -O0 -triple x86_64-unknown-linux-gnu -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -O0 -triple x86_64-unknown-linux-gnu -emit-llvm -o - | FileCheck -check-prefix=CHECK-NO-MERGE-CONSTANTS %s +// RUN: %clang_cc1 %s -O0 -triple x86_64-unknown-linux-gnu -fmerge-all-constants -emit-llvm -o - | FileCheck -check-prefix=CHECK-MERGE-CONSTANTS %s -// CHECK: @{{.*}}.a1 = internal constant [5 x i32] [i32 0, i32 1, i32 2, i32 0, i32 0] -// CHECK: @{{.*}}.a2 = internal constant [5 x i32] zeroinitializer -// CHECK: @{{.*}}.a3 = internal constant [5 x i32] zeroinitializer +// CHECK-NO-MERGE-CONSTANTS: @{{.*}}.a1 = private unnamed_addr constant [5 x i32] [i32 0, i32 1, i32 2, i32 0, i32 0] + +// CHECK-MERGE-CONSTANTS: @{{.*}}.a1 = internal constant [5 x i32] [i32 0, i32 1, i32 2, i32 0, i32 0] +// CHECK-MERGE-CONSTANTS: @{{.*}}.a2 = internal constant [5 x i32] zeroinitializer +// CHECK-MERGE-CONSTANTS: @{{.*}}.a3 = internal constant [5 x i32] zeroinitializer void testConstArrayInits(void) { |