forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeGen] Provide source locations for UBSan type checks when emittin…
…g constructor calls. Differential Revision: https://reviews.llvm.org/D48531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335445 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
d80dd82
commit 6463d22
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux -emit-llvm -fsanitize=alignment -fblocks %s -o %t.ll | ||
// RUN: FileCheck -check-prefix=ZEROINIT < %t.ll %s | ||
// RUN: FileCheck -check-prefix=SRCLOC < %t.ll %s | ||
// ZEROINIT-NOT: @{{.+}} = private unnamed_addr global {{.+}} zeroinitializer | ||
|
||
struct A { | ||
A(int); | ||
int k; | ||
}; | ||
|
||
struct B : A { | ||
B(); | ||
B(const B &); | ||
// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 12 } | ||
using A::A; | ||
void f() const; | ||
}; | ||
|
||
// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 10 } | ||
B::B() : A(1) {} | ||
|
||
void foo() { | ||
B b(2); | ||
// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 5 } | ||
^{b.f();}(); | ||
} |