16 lines · plain
1; Test general-dynamic TLS access optimizations.2;3; If we access the same TLS variable twice, there should only be4; a single call to __tls_get_offset.5;6; RUN: llc < %s -mcpu=z10 -mtriple=s390x-linux-gnu -relocation-model=pic | grep "__tls_get_offset" | count 17 8@x = thread_local global i32 09 10define i32 @foo() {11 %val = load i32, ptr @x12 %inc = add nsw i32 %val, 113 store i32 %inc, ptr @x14 ret i32 %val15}16