xref: /llvm-project/bolt/test/X86/icf-safe-test1-no-relocs.test (revision 3c357a49d61e4c81a1ac016502ee504521bc8dda)
1## Check that BOLT reports an error for a binary with no relocations with the --icf=safe option.
2
3# REQUIRES: system-linux, asserts
4# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
5# RUN: %clang %cflags %t1.o -o %t.exe
6# RUN: not llvm-bolt --no-threads %t.exe --icf=safe -o %t.bolt 2>&1 | FileCheck --check-prefix=SAFEICFCHECK %s
7
8# SAFEICFCHECK: BOLT-ERROR: binary built without relocations. Safe ICF is not supported
9
10## int main(int argc, char **argv) {
11##   return temp;
12## }
13	.globl	main
14	.type	main,@function
15main:
16	.cfi_startproc
17	retq
18.Lfunc_end8:
19	.size	main, .-main
20	.cfi_endproc
21