42 lines · plain
1; Check that we correctly handle 'ReadOnly' attribute when computing cache key2; RUN: opt -module-summary -module-hash %s -o %t1.bc3; RUN: opt -module-summary -module-hash %p/Inputs/index-const-prop-cache-foo.ll -o %t2.bc4; RUN: opt -module-summary -module-hash %p/Inputs/index-const-prop-cache-test1.ll -o %t3.bc5; RUN: opt -module-summary -module-hash %p/Inputs/index-const-prop-cache-test2.ll -o %t4.bc6; RUN: rm -Rf %t.cache && mkdir %t.cache7 8; Here @gFoo variable is writeable9; RUN: llvm-lto -thinlto-action=run %t1.bc %t4.bc %t2.bc \10; RUN: -exported-symbol=main -exported-symbol=test -thinlto-cache-dir=%t.cache11; RUN: ls %t.cache/llvmcache-* | count 312 13; Now gFoo is read-only and all modules should get different cache keys.14; RUN: llvm-lto -thinlto-action=run %t1.bc %t3.bc %t2.bc \15; RUN: -exported-symbol=main -exported-symbol=test -thinlto-cache-dir=%t.cache16; RUN: ls %t.cache/llvmcache-* | count 617 18; Do the same but with llvm-lto219; RUN: rm -Rf %t.cache && mkdir %t.cache20; RUN: llvm-lto2 run %t1.bc %t4.bc %t2.bc -cache-dir=%t.cache -o %t5 \21; RUN: -r=%t1.bc,main,plx -r=%t1.bc,foo,l \22; RUN: -r=%t4.bc,test,plx -r=%t4.bc,foo,l -r=%t4.bc,bar,l \23; RUN: -r=%t2.bc,foo,pl -r=%t2.bc,bar,pl -r=%t2.bc,rand,24; RUN: ls %t.cache/llvmcache-* | count 325 26; RUN: llvm-lto2 run %t1.bc %t3.bc %t2.bc -cache-dir %t.cache -o %t6 \27; RUN: -r=%t1.bc,main,plx -r=%t1.bc,foo,l \28; RUN: -r=%t3.bc,test,plx -r=%t3.bc,foo,l \29; RUN: -r=%t2.bc,foo,pl -r=%t2.bc,bar,pl -r=%t2.bc,rand,30; RUN: ls %t.cache/llvmcache-* | count 631 32target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"33target triple = "x86_64-unknown-linux-gnu"34 35; Function Attrs: nounwind ssp uwtable36define i32 @main() local_unnamed_addr {37 %1 = tail call i32 (...) @foo()38 ret i32 %139}40 41declare i32 @foo(...) local_unnamed_addr42