30 lines · c
1// REQUIRES: x86-registered-target2 3// RUN: split-file %s %t4// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -flto=thin -emit-llvm-bc %t/a.c -o %t/a.bc5// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -flto=thin -emit-llvm-bc %t/b.c -o %t/b.bc6// RUN: llvm-nm %t/a.bc | FileCheck %s --check-prefix=NM7 8// RUN: llvm-lto2 run %t/a.bc %t/b.bc -o %t/out -save-temps -r=%t/a.bc,ref,plx -r=%t/b.bc,ff_h264_cabac_tables,pl9// RUN: llvm-dis < %t/out.2.2.internalize.bc | FileCheck %s10 11//--- a.c12/// IR symtab does not track inline asm symbols, so we don't know13/// ff_h264_cabac_tables is undefined.14// NM-NOT: {{.}}15// NM: ---------------- T ref16// NM-NOT: {{.}}17const char *ref(void) {18 const char *ret;19 asm("lea ff_h264_cabac_tables(%%rip), %0" : "=r"(ret));20 return ret;21}22 23//--- b.c24/// ff_h264_cabac_tables has __attribute__((used)) in the source code, which means25/// its definition must be retained because there can be references the compiler26/// cannot see (inline asm reference). Test we don't internalize it.27// CHECK: @ff_h264_cabac_tables = dso_local constant [1 x i8] c"\09"28__attribute__((used))29const char ff_h264_cabac_tables[1] = "\x09";30