Skip to content

Commit 2eadee2

Browse files
committed
[BOLT][test] Fix uses of clang C exe for C++ files
The C frontend executable will fail if there's for example a Clang resource file for the C++ mode that sets C++-specific options: ``` + /home/tambre/dev/llvm/build/bin/clang --target=x86_64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -pie -fPIC -shared /home/tambre/dev/llvm/bolt/test/R_ABS.pic.lld.cpp -o /home/tambre/dev/llvm/build/tools/bolt/test/Output/R_ABS.pic.lld.cpp.tmp.so -Wl,-q -fuse-ld=lld clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] error: invalid argument '-std=c23' not allowed with 'C++' ```
1 parent c0efcc0 commit 2eadee2

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

bolt/test/AArch64/double_jump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// A contrived example to test the double jump removal peephole.
22

3-
// RUN: %clang %cflags -O0 %s -o %t.exe
3+
// RUN: %clangxx %cxxflags -O0 %s -o %t.exe
44
// RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=double-jumps | \
55
// RUN: FileCheck %s -check-prefix=CHECKBOLT
66
// RUN: llvm-objdump --no-print-imm-hex -d %t.bolt | FileCheck %s

bolt/test/R_ABS.pic.lld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* with libc available.
77
* REQUIRES: system-linux
88
*
9-
* RUN: %clang %cflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
9+
* RUN: %clangxx %cxxflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
1010
* RUN: llvm-bolt %t.so -o %t.so.bolt --relocs
1111
*/
1212

bolt/test/X86/double-jump.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## correctly on Windows e.g. subshell execution
55
REQUIRES: shell
66

7-
RUN: %clang %cflags %p/Inputs/double_jump.cpp -o %t.exe
7+
RUN: %clangxx %cxxflags %p/Inputs/double_jump.cpp -o %t.exe
88
RUN: (llvm-bolt %t.exe --peepholes=double-jumps \
99
RUN: --eliminate-unreachable -o %t 2>&1 \
1010
RUN: && llvm-objdump -d %t --print-imm-hex --no-show-raw-insn) | FileCheck %s

bolt/test/X86/jmp-optimization.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## correctly on Windows e.g. unsupported parameter expansion
55
REQUIRES: shell
66

7-
RUN: %clang %cflags -O2 %S/Inputs/jmp_opt{,2,3}.cpp -o %t
7+
RUN: %clangxx %cxxflags -O2 %S/Inputs/jmp_opt{,2,3}.cpp -o %t
88
RUN: llvm-bolt -inline-small-functions %t -o %t.bolt
99
RUN: llvm-objdump -d %t.bolt --print-imm-hex | FileCheck %s
1010

bolt/test/X86/match-functions-with-call-graph.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# REQUIRES: system-linux
44
# RUN: split-file %s %t
5-
# RUN: %clang %cflags %t/main.cpp -o %t.exe -Wl,-q -nostdlib
5+
# RUN: %clangxx %cxxflags %t/main.cpp -o %t.exe -Wl,-q -nostdlib
66
# RUN: llvm-bolt %t.exe -o %t.out --data %t/yaml --profile-ignore-hash -v=1 \
77
# RUN: --dyno-stats --print-cfg --infer-stale-profile=1 --match-with-call-graph 2>&1 | FileCheck %s
88

bolt/test/pie.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## on Linux systems where the host triple matches the target.
55
REQUIRES: system-linux
66

7-
RUN: %clang %cflags -fPIC -pie %p/Inputs/jump_table_icp.cpp -o %t
7+
RUN: %clangxx %cxxflags -fPIC -pie %p/Inputs/jump_table_icp.cpp -o %t
88
RUN: llvm-bolt %t -o %t.null 2>&1 | FileCheck %s
99

1010
CHECK: BOLT-INFO: shared object or position-independent executable detected

bolt/test/runtime/bolt-reserved.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* new sections.
66
*/
77

8-
// RUN: %clang %s -o %t.exe -Wl,-q
8+
// RUN: %clangxx %s -o %t.exe -Wl,-q
99
// RUN: llvm-bolt %t.exe -o %t.bolt.exe 2>&1 | FileCheck %s
1010
// RUN: %t.bolt.exe
1111

@@ -16,7 +16,7 @@
1616
* not enough for allocating new sections.
1717
*/
1818

19-
// RUN: %clang %s -o %t.tiny.exe -Wl,--no-eh-frame-hdr -Wl,-q -DTINY
19+
// RUN: %clangxx %s -o %t.tiny.exe -Wl,--no-eh-frame-hdr -Wl,-q -DTINY
2020
// RUN: not llvm-bolt %t.tiny.exe -o %t.tiny.bolt.exe 2>&1 | \
2121
// RUN: FileCheck %s --check-prefix=CHECK-TINY
2222

0 commit comments

Comments
 (0)