33 lines · plain
1/* Compile with:2 cat >modules.modulemap <<EOF3 module mismatch {4 header "mismatch.h"5 }6 EOF7 echo "struct s;"> mismatch.h8 clang -cc1 -emit-obj -fmodules -fmodule-map-file=modules.modulemap \9 -fmodule-format=obj -g -dwarf-ext-refs -fmodules-cache-path=. \10 -fdisable-module-hash mismatch.m -o 1.o11 echo > mismatch.h12 clang -cc1 -emit-obj -fmodules -fmodule-map-file=modules.modulemap \13 -fmodule-format=obj -g -dwarf-ext-refs -fmodules-cache-path=. \14 -fdisable-module-hash mismatch.m -o /dev/null15*/16 17// RUN: rm -rf %t.dir && mkdir %t.dir18// RUN: cp %p/../Inputs/mismatch/1.o %p/../Inputs/mismatch/mismatch.pcm %t.dir19// RUN: cp %p/../Inputs/mismatch/1.o %t.dir/2.o20// RUN: dsymutil --verbose -f -oso-prepend-path=%t.dir \21// RUN: -y %p/dummy-debug-map.map -o %t.bin 2>&1 | FileCheck %s22// RUN: dsymutil --linker parallel --verbose -f -oso-prepend-path=%t.dir \23// RUN: -y %p/dummy-debug-map.map -o %t.bin 2>&1 | FileCheck %s24 25@import mismatch;26 27void f() {}28// Mismatch after importing the module.29// CHECK: warning: hash mismatch30// Mismatch in the cache.31// CHECK: warning: hash mismatch32// CHECK: cached33