Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / debug-info-file-checksum.c
blobe018dbf64fc98f2b7a09cf8483d34ba9848a62b4
1 // RUN: %clang -emit-llvm -S -g -gcodeview -x c \
2 // RUN: %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s
3 // RUN: %clang -emit-llvm -S -g -gcodeview -Xclang -gsrc-hash=md5 \
4 // RUN: -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s
5 // RUN: %clang -emit-llvm -S -g -gcodeview -Xclang -gsrc-hash=sha1 \
6 // RUN: -x c %S/Inputs/debug-info-file-checksum.c -o - \
7 // RUN: | FileCheck --check-prefix=SHA1 %s
8 // RUN: %clang -emit-llvm -S -g -gcodeview -Xclang -gsrc-hash=sha256 \
9 // RUN: -x c %S/Inputs/debug-info-file-checksum.c -o - \
10 // RUN: | FileCheck --check-prefix=SHA256 %s
11 // RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s
12 // RUN: %clang -emit-llvm -S -gdwarf-5 -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s
14 // Check that "checksum" is created correctly for the compiled file.
16 // CHECK: !DIFile(filename:{{.*}}, directory:{{.*}}, checksumkind: CSK_MD5, checksum: "a3b7d27af071accdeccaa933fc603608")
17 // SHA1: !DIFile(filename:{{.*}}, directory:{{.*}}, checksumkind: CSK_SHA1, checksum: "6f6eeaba705ad6db6fbb05c2cbcf3cbb3e374bcd")
18 // SHA256: !DIFile(filename:{{.*}}, directory:{{.*}}, checksumkind: CSK_SHA256, checksum: "2d49b53859e57898a0f8c16ff1fa4d99306b8ec28d65cf7577109761f0d56197")
20 // Ensure #line directives (in already pre-processed files) do not emit checksums
21 // RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum-pre.cpp -o - | FileCheck %s --check-prefix NOCHECKSUM
23 // NOCHECKSUM: !DIFile(filename: "{{.*}}code-coverage-filter1.h", directory: "{{[^"]*}}")
24 // NOCHECKSUM: !DIFile(filename: "{{.*}}code-coverage-filter2.h", directory: "{{[^"]*}}")
25 // NOCHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum.c", directory: "{{[^"]*}}")
27 // Ensure #line directives without name do emit checksums
28 // RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum-line.cpp -o - | FileCheck %s --check-prefix CHECKSUM
30 // CHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum-line.cpp", directory:{{.*}}, checksumkind: CSK_MD5, checksum: "e13bca9b34ed822d596a519c9ce60995")