Skip to content

Commit 5977766

Browse files
authored
[KeyInstr][Clang][NFC] Add test for array cookie store (#146517)
It doesn't need to be a Key Instruction.
1 parent 8226fbe commit 5977766

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -debug-info-kind=line-tables-only -gno-column-info -emit-llvm -o - \
2+
// RUN: | FileCheck %s
3+
4+
// Array cookie store doesn't need to be a key instruction.
5+
6+
struct a { char c; ~a(); };
7+
void b() { new a[2]; }
8+
9+
// CHECK: %call = call {{.*}}ptr @_Znam(i64 noundef 10)
10+
// CHECK-NEXT: store i64 2, ptr %call, align 8, !dbg [[DBG:!.*]]
11+
12+
// CHECK: [[DBG]] = !DILocation(line: 7, scope: ![[#]])

0 commit comments

Comments
 (0)