Skip to content

Commit

Permalink
[Clang, SystemZ] Split test into Driver and CodeGen parts (NFC) (#79808)
Browse files Browse the repository at this point in the history
The test added in #73511 currently fails in
CLANG_DEFAULT_PIE_ON_LINUX=OFF configuration, because it uses the clang
driver in a codegen test.

Split the test into two, a driver test that checks that the appropriate
target feature is passed, and a codegen test that uses cc1.
  • Loading branch information
nikic committed Jan 29, 2024
1 parent 754a8ad commit 6d24291
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 4 additions & 7 deletions clang/test/CodeGen/SystemZ/unaligned-symbols.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: | FileCheck %s -check-prefixes=CHECK,ALIGNED

// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
// RUN: -mno-unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED
// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: -target-feature -unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED

// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
// RUN: -munaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN

// RUN: %clang -cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: -target-feature +unaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN


Expand Down
7 changes: 7 additions & 0 deletions clang/test/Driver/s390x-unaligned-symbols.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: %clang -target s390x-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
// RUN: %clang -target s390x-linux-gnu -mno-unaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=ALIGNED %s
// RUN: %clang -target s390x-linux-gnu -munaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=UNALIGN %s

// DEFAULT-NOT: unaligned-symbols"
// ALIGNED: "-target-feature" "-unaligned-symbols"
// UNALIGN: "-target-feature" "+unaligned-symbols"

0 comments on commit 6d24291

Please sign in to comment.