
This patch fixes PR44896. For IR input files, option fdiscard-value-names should be ignored as we need named values in loadModule(). Commit 60d3947922 sets this option after loadModule() where valued names already created. This creates an inconsistent state in setNameImpl() that leads to a seg fault. This patch forces fdiscard-value-names to be false for IR input files. This patch also emits a warning of "ignoring -fdiscard-value-names" if option fdiscard-value-names is explictly enabled in the commandline for IR input files. Differential Revision: https://reviews.llvm.org/D74878
16 lines
561 B
LLVM
16 lines
561 B
LLVM
; RUN: %clang -fdiscard-value-names -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=WARNING %s
|
|
; RUN: %clang -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=NOWARNING %s
|
|
; RUN: %clang_cc1 -S -emit-llvm %s -discard-value-names -o /dev/null
|
|
; PR 44896
|
|
|
|
; WARNING: ignoring -fdiscard-value-names for LLVM Bitcode
|
|
; NOWARNING-NOT: ignoring -fdiscard-value-names for LLVM Bitcode
|
|
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64--linux-gnu"
|
|
|
|
define linkonce i8* @b(i8* %a) {
|
|
ret i8* %a
|
|
}
|
|
|