1*105151caSRaphael Isemann // Tests that dwoIds in modules match the dwoIDs in the main file.
2*105151caSRaphael Isemann 
3*105151caSRaphael Isemann // REQUIRES: asserts
4*105151caSRaphael Isemann 
5*105151caSRaphael Isemann // RUN: rm -rf %t.cache
6*105151caSRaphael Isemann // RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -dwarf-ext-refs -fimplicit-module-maps -fmodules-cache-path=%t.cache %s -I %S/Inputs -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer 2> %t.mod-out
7*105151caSRaphael Isemann // RUN: cat %t.ll %t.mod-out | FileCheck %s
8*105151caSRaphael Isemann // RUN: cat %t.ll | FileCheck --check-prefix=CHECK-REALIDS %s
9*105151caSRaphael Isemann // RUN: cat %t.mod-out | FileCheck --check-prefix=CHECK-REALIDS %s
10*105151caSRaphael Isemann 
11*105151caSRaphael Isemann @import DebugDwoId;
12*105151caSRaphael Isemann 
13*105151caSRaphael Isemann Dummy d;
14*105151caSRaphael Isemann 
15*105151caSRaphael Isemann // Find the emitted dwoID for DebugInfoId and compare it against the one in the PCM.
16*105151caSRaphael Isemann // CHECK: DebugDwoId-{{[A-Z0-9]+}}.pcm
17*105151caSRaphael Isemann // CHECK-SAME: dwoId: [[DWOID:[0-9]+]]
18*105151caSRaphael Isemann // CHECK: dwoId: [[DWOID]]
19*105151caSRaphael Isemann // CHECK-NEXT: !DIFile(filename: "DebugDwoId"
20*105151caSRaphael Isemann 
21*105151caSRaphael Isemann // Make sure the dwo IDs are real IDs and not fallback values (~1ULL).
22*105151caSRaphael Isemann // CHECK-REALIDS-NOT: dwoId: 18446744073709551615
23