Skip to content

Commit 0277a24

Browse files
committed
[clang][test] Update -fc++-abi tests
This attempts to move driver tests out of Frontend and to Driver, separates RUNs that should fail from RUNs that should succeed, and prevent creating output files or dumping output. Differential Revision: https://reviews.llvm.org/D101867
1 parent 347f69c commit 0277a24

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

clang/test/Driver/cxx-abi-flag.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Ensure that the driver flag is propagated to cc1.
2+
// RUN: %clang -### -fc++-abi=itanium -target x86_64-unknown-linux-gnu %s \
3+
// RUN: 2>&1 | FileCheck %s -check-prefix=ITANIUM
4+
// RUN: %clang -### -fc++-abi=fuchsia -target x86_64-unknown-fuchsia %s \
5+
// RUN: 2>&1 | FileCheck %s -check-prefix=FUCHSIA
6+
// RUN: %clang -### -fc++-abi=microsoft -target x86_64-unknown-windows-msvc %s \
7+
// RUN: 2>&1 | FileCheck %s -check-prefix=MICROSOFT
8+
//
9+
// ITANIUM: -fc++-abi=itanium
10+
// FUCHSIA: -fc++-abi=fuchsia
11+
// MICROSOFT: -fc++-abi=microsoft
Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
// REQUIRES: x86-registered-target
2-
3-
// These should succeed.
4-
// RUN: %clang -c -fc++-abi=itanium -target x86_64-unknown-linux-gnu %s
5-
// RUN: %clang -c -fc++-abi=fuchsia -target x86_64-unknown-fuchsia %s
6-
// RUN: %clang -c -fc++-abi=microsoft -target x86_64-windows-msvc %s
7-
// RUN: %clang_cc1 -fc++-abi=itanium -triple x86_64-unknown-linux-gnu %s
8-
// RUN: %clang_cc1 -fc++-abi=fuchsia -triple x86_64-unknown-fuchsia %s
9-
// RUN: %clang_cc1 -fc++-abi=microsoft -triple x86_64-windows-msvc %s
10-
11-
// RUN: not %clang -c -fc++-abi=InvalidABI %s 2>&1 | FileCheck %s -check-prefix=INVALID
12-
// RUN: not %clang -c -fc++-abi=Fuchsia %s 2>&1 | FileCheck %s -check-prefix=CASE-SENSITIVE
13-
// RUN: not %clang_cc1 -fc++-abi=InvalidABI %s 2>&1 | FileCheck %s -check-prefix=INVALID
14-
// RUN: not %clang_cc1 -fc++-abi=Fuchsia %s 2>&1 | FileCheck %s -check-prefix=CASE-SENSITIVE
1+
// These shouldn't be valid -fc++-abi values.
2+
// RUN: not %clang_cc1 -S -emit-llvm -o /dev/null -fc++-abi=InvalidABI %s 2>&1 | FileCheck %s -check-prefix=INVALID
3+
// RUN: not %clang_cc1 -S -emit-llvm -o /dev/null -fc++-abi=Fuchsia %s 2>&1 | FileCheck %s -check-prefix=CASE-SENSITIVE
154
// INVALID: error: Invalid C++ ABI name 'InvalidABI'
165
// CASE-SENSITIVE: error: Invalid C++ ABI name 'Fuchsia'
176

18-
// The flag is propgated from the driver to cc1.
19-
// RUN: %clang -fc++-abi=InvalidABI %s -### 2>&1 | FileCheck %s -check-prefix=CC1-FLAG
20-
// CC1-FLAG: -fc++-abi=InvalidABI
21-
227
// Some C++ ABIs are not supported on some platforms.
23-
// RUN: not %clang_cc1 -c -fc++-abi=fuchsia -triple i386 %s 2>&1 | FileCheck %s -check-prefix=UNSUPPORTED-FUCHSIA
8+
// RUN: not %clang_cc1 -S -emit-llvm -o /dev/null -fc++-abi=fuchsia -triple i386 %s 2>&1 | FileCheck %s -check-prefix=UNSUPPORTED-FUCHSIA
249
// UNSUPPORTED-FUCHSIA: error: C++ ABI 'fuchsia' is not supported on target triple 'i386'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// These should be valid cxx abi flags for these targets.
2+
// RUN: %clang_cc1 -fc++-abi=itanium -triple x86_64-unknown-linux-gnu %s -S -emit-llvm -o /dev/null
3+
// RUN: %clang_cc1 -fc++-abi=fuchsia -triple x86_64-unknown-fuchsia %s -S -emit-llvm -o /dev/null
4+
// RUN: %clang_cc1 -fc++-abi=microsoft -triple x86_64-windows-msvc %s -S -emit-llvm -o /dev/null

0 commit comments

Comments
 (0)