diff --git a/driver/ir2obj_cache.cpp b/driver/ir2obj_cache.cpp index 3949bbaa2d..a84f4de6ac 100644 --- a/driver/ir2obj_cache.cpp +++ b/driver/ir2obj_cache.cpp @@ -183,6 +183,9 @@ void outputIR2ObjRelevantCmdlineArgs(llvm::raw_ostream &hash_os) // All "-ir2..." options can be ignored if (arg[1] == 'i' && arg[2] == 'r' && arg[3] == '2') continue; + // Ignore "-lib" + if (arg[1] == 'l' && arg[2] == 'i' && arg[3] == 'b' && !arg[4]) + continue; // All effects of -d-version... are already included in the IR hash. if (strncmp(arg+1, "d-version", 9) == 0) continue; diff --git a/tests/linking/ir2obj_caching_flags1.d b/tests/linking/ir2obj_caching_flags1.d index 4db51c54d6..06022fb340 100644 --- a/tests/linking/ir2obj_caching_flags1.d +++ b/tests/linking/ir2obj_caching_flags1.d @@ -29,6 +29,7 @@ // RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -D -H -I. -J. -vv | FileCheck --check-prefix=MUST_HIT %s \ // RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -d-version=Irrelevant -vv | FileCheck --check-prefix=MUST_HIT %s \ // RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -unittest -vv | FileCheck --check-prefix=MUST_HIT %s \ +// RUN: && %ldc %s -ir2obj-cache=%T/flag1cache -lib -vv | FileCheck --check-prefix=MUST_HIT %s \ // RUN: && %ldc -ir2obj-cache=%T/flag1cache -vv -run %s | FileCheck --check-prefix=COULD_HIT %s \ // RUN: && %ldc -ir2obj-cache=%T/flag1cache -vv -run %s a b | FileCheck --check-prefix=MUST_HIT %s \ // RUN: && %ldc %s -c -of=%t%obj -ir2obj-cache=%T/flag1cache -g -vv | FileCheck --check-prefix=MUST_HIT %s