summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/debug-info-codeview-unnamed.c
blob: bd2a7543e56b2ba10986826c0596dfc5fae0d33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=limited -S -emit-llvm -o - %s | FileCheck --check-prefix LINUX %s
// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -S -emit-llvm -o - %s | FileCheck --check-prefix MSVC %s

int main(int argc, char* argv[], char* arge[]) {

  // In both DWARF and CodeView, an unnamed C structure type will generate a
  // DICompositeType without a name or identifier attribute;
  //
  struct { int bar; } one = {42};
  //
  // LINUX:      !{{[0-9]+}} = !DILocalVariable(name: "one"
  // LINUX-SAME:     type: [[TYPE_OF_ONE:![0-9]+]]
  // LINUX-SAME:     )
  // LINUX:      [[TYPE_OF_ONE]] = distinct !DICompositeType(
  // LINUX-SAME:     tag: DW_TAG_structure_type
  // LINUX-NOT:      name:
  // LINUX-NOT:      identifier:
  // LINUX-SAME:     )
  //
  // MSVC:       !{{[0-9]+}} = !DILocalVariable(name: "one"
  // MSVC-SAME:      type: [[TYPE_OF_ONE:![0-9]+]]
  // MSVC-SAME:      )
  // MSVC:       [[TYPE_OF_ONE]] = distinct !DICompositeType
  // MSVC-SAME:      tag: DW_TAG_structure_type
  // MSVC-NOT:       name:
  // MSVC-NOT:       identifier:
  // MSVC-SAME:      )

  return 0;
}