Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / debug-info-codeview-unnamed.c
blobbd2a7543e56b2ba10986826c0596dfc5fae0d33d
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=limited -S -emit-llvm -o - %s | FileCheck --check-prefix LINUX %s
2 // RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -S -emit-llvm -o - %s | FileCheck --check-prefix MSVC %s
4 int main(int argc, char* argv[], char* arge[]) {
6 // In both DWARF and CodeView, an unnamed C structure type will generate a
7 // DICompositeType without a name or identifier attribute;
8 //
9 struct { int bar; } one = {42};
11 // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "one"
12 // LINUX-SAME: type: [[TYPE_OF_ONE:![0-9]+]]
13 // LINUX-SAME: )
14 // LINUX: [[TYPE_OF_ONE]] = distinct !DICompositeType(
15 // LINUX-SAME: tag: DW_TAG_structure_type
16 // LINUX-NOT: name:
17 // LINUX-NOT: identifier:
18 // LINUX-SAME: )
20 // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "one"
21 // MSVC-SAME: type: [[TYPE_OF_ONE:![0-9]+]]
22 // MSVC-SAME: )
23 // MSVC: [[TYPE_OF_ONE]] = distinct !DICompositeType
24 // MSVC-SAME: tag: DW_TAG_structure_type
25 // MSVC-NOT: name:
26 // MSVC-NOT: identifier:
27 // MSVC-SAME: )
29 return 0;