| 1 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=limited -emit-llvm -o - %s | FileCheck --check-prefix LINUX %s |
| 2 |
// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - %s | FileCheck --check-prefix MSVC %s |
| 3 |
|
| 4 |
int main(int argc, char* argv[], char* arge[]) { |
| 5 |
|
| 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}; |
| 10 |
// |
| 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: ) |
| 19 |
// |
| 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: ) |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |