Skip to content

Commit 21041c9

Browse files
authored
[NFCI][lldb][test] Fix mismatched C/C++ substitutions (llvm#165773)
Most of the cases were where a C++ file was being compiled with the C substitution. There were a few cases of the opposite though. LLDB seems to be the only real culprit in the LLVM codebase for these mismatches. Rest of the LLVM presumably sticks at least language-specific options in the common substitutions making the mistakes immediately apparent. I found these by using Clang frontend configuration files containing language-specific options for both C and C++ (e.g. `-std=c2y` and `-std=c++26`).
1 parent 4174429 commit 21041c9

File tree

56 files changed

+116
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+116
-116
lines changed

lldb/test/API/functionalities/breakpoint/same_cu_name/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ LD_EXTRAS := ns1.o ns2.o ns3.o ns4.o
44
a.out: main.o ns1.o ns2.o ns3.o ns4.o
55

66
ns1.o: common.cpp
7-
$(CC) -gdwarf -c -DNAMESPACE=ns1 -o $@ $<
7+
$(CXX) -gdwarf -c -DNAMESPACE=ns1 -o $@ $<
88

99
ns2.o: common.cpp
10-
$(CC) -gdwarf -c -DNAMESPACE=ns2 -o $@ $<
10+
$(CXX) -gdwarf -c -DNAMESPACE=ns2 -o $@ $<
1111

1212
ns3.o: common.cpp
13-
$(CC) -gdwarf -c -DNAMESPACE=ns3 -o $@ $<
13+
$(CXX) -gdwarf -c -DNAMESPACE=ns3 -o $@ $<
1414

1515
ns4.o: common.cpp
16-
$(CC) -gdwarf -c -DNAMESPACE=ns4 -o $@ $<
16+
$(CXX) -gdwarf -c -DNAMESPACE=ns4 -o $@ $<
1717

1818

1919
include Makefile.rules

lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
# JITLink is the Orc-specific JIT linker implementation.
55
#
6-
# RUN: %clang -g -S -emit-llvm -fPIC --target=x86_64-unknown-unknown-elf \
7-
# RUN: -o %t.ll %p/Inputs/jitbp.cpp
6+
# RUN: %clangxx -g -S -emit-llvm -fPIC --target=x86_64-unknown-unknown-elf \
7+
# RUN: -o %t.ll %p/Inputs/jitbp.cpp
88
# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' \
99
# RUN: -o 'run --jit-linker=jitlink %t.ll' lli | FileCheck %s
1010

lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
# RuntimeDyld can be used to link and load emitted code for both, MCJIT and Orc.
55
#
6-
# RUN: %clang -g -S -emit-llvm --target=x86_64-unknown-unknown-elf \
7-
# RUN: -o %t.ll %p/Inputs/jitbp.cpp
6+
# RUN: %clangxx -g -S -emit-llvm --target=x86_64-unknown-unknown-elf \
7+
# RUN: -o %t.ll %p/Inputs/jitbp.cpp
88
#
99
# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' \
1010
# RUN: -o 'run --jit-kind=mcjit %t.ll' lli | FileCheck %s

lldb/test/Shell/Commands/command-image-dump-ast-colored.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Test AST dumping with and without color.
22

33
# RUN: split-file %s %t
4-
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
4+
# RUN: %clangxx_host -g -gdwarf %t/main.cpp -o %t.out
55
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \
66
# RUN: | FileCheck %s
77

lldb/test/Shell/Commands/command-image-dump-ast.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# UNSUPPORTED: system-windows
66

77
# RUN: split-file %s %t
8-
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
8+
# RUN: %clangxx_host -g -gdwarf %t/main.cpp -o %t.out
99
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \
1010
# RUN: | FileCheck %s
1111

lldb/test/Shell/Commands/list-header.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# XFAIL: target-windows
44

55
## Test that `list header.h:<line>` works correctly when header is available.
6-
##
6+
##
77
# RUN: split-file %s %t
88

9-
# RUN: %clang_host -g %t/main_with_inlined.cc %t/foo.cc -o %t/main_with_inlined.out
10-
# RUN: %clang_host -g %t/main_no_inlined.cc %t/foo.cc -o %t/main_no_inlined.out
9+
# RUN: %clangxx_host -g %t/main_with_inlined.cc %t/foo.cc -o %t/main_with_inlined.out
10+
# RUN: %clangxx_host -g %t/main_no_inlined.cc %t/foo.cc -o %t/main_no_inlined.out
1111

1212
# RUN: %lldb %t/main_with_inlined.out -o "list foo.h:2" -o "exit" 2>&1 \
1313
# RUN: | FileCheck %s --check-prefix=CHECK-INLINED
@@ -19,7 +19,7 @@
1919

2020
# CHECK-INLINED: 2 extern int* ptr;
2121
# CHECK-INLINED: 3 void f(int x);
22-
# CHECK-INLINED: 4
22+
# CHECK-INLINED: 4
2323
# CHECK-INLINED: 5 inline void g(int x) {
2424
# CHECK-INLINED: 6 *ptr = x; // should crash here
2525
# CHECK-INLINED: 7 }

lldb/test/Shell/Error/cleanup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Test CommandObject is cleaned up even after commands fail due to not taking any argument.
2-
// RUN: %clang_host -g %s -o %t
2+
// RUN: %clangxx_host -g %s -o %t
33
// RUN: %lldb -f %t -o "settings set interpreter.stop-command-source-on-error false" -s \
44
// RUN: %S/Inputs/cleanup.lldbinit
55
int main() { return 0; }

lldb/test/Shell/Expr/TestExprLanguageNote.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# RUN: split-file %s %t
2-
# RUN: %clang_host -g %t/main.cpp -o %t.out
2+
# RUN: %clangxx_host -g %t/main.cpp -o %t.out
33
#
44
# RUN: %lldb -x -b -o "settings set interpreter.stop-command-source-on-error false" \
55
# RUN: -s %t/no-target.input 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TARGET

lldb/test/Shell/Expr/TestLambdaExprImport.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# uses always).
44

55
# RUN: split-file %s %t
6-
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
6+
# RUN: %clangxx_host -g -gdwarf %t/main.cpp -o %t.out
77
# RUN: %lldb -o "settings set interpreter.stop-command-source-on-error false" \
88
# RUN: -x -b -s %t/commands.input %t.out 2>&1 \
99
# RUN: | FileCheck %s

lldb/test/Shell/ObjectFile/ELF/elf-memory.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// - verify that "image dump objfile" will dump the dynamic section of the
1212
// memory elf file and find the .dynamic string table.
1313

14-
// RUN: %clang_host %p/Inputs/memory-elf.cpp -g -O0 -o %t
14+
// RUN: %clangxx_host %p/Inputs/memory-elf.cpp -g -O0 -o %t
1515

1616
// RUN: %lldb %t -b \
1717
// RUN: -o "b main" \

0 commit comments

Comments
 (0)