-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run non-filechecked commands in update_cc_test_checks.py
Some tests in clang require running non-filechecked commands to generate the actual filecheck input. For example, tests for openmp offloading require generating the host bc without any checking, before running the clang command to actually generate the filechecked IR of the target device. This patch enables `update_cc_test_checks.py` to run non-filechecked run lines in-place. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D97068
- Loading branch information
1 parent
a89a3c2
commit 60d4c73
Showing
4 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
clang/test/utils/update_cc_test_checks/Inputs/exec-all-runlines.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Check that the non-clang/non-filechecked runlines execute | ||
// RUN: cp %s %s.copy.c | ||
// RUN: %clang_cc1 -fopenmp %s.copy.c -emit-llvm-bc -o %t-host.bc | ||
// RUN: %clang_cc1 -fopenmp -fopenmp-host-ir-file-path %t-host.bc %s.copy.c -emit-llvm -o - | FileCheck %s | ||
|
||
void use(int); | ||
|
||
void test(int a) | ||
{ | ||
} |
17 changes: 17 additions & 0 deletions
17
clang/test/utils/update_cc_test_checks/Inputs/exec-all-runlines.c.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// Check that the non-clang/non-filechecked runlines execute | ||
// RUN: cp %s %s.copy.c | ||
// RUN: %clang_cc1 -fopenmp %s.copy.c -emit-llvm-bc -o %t-host.bc | ||
// RUN: %clang_cc1 -fopenmp -fopenmp-host-ir-file-path %t-host.bc %s.copy.c -emit-llvm -o - | FileCheck %s | ||
|
||
void use(int); | ||
|
||
// CHECK-LABEL: @test( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 | ||
// CHECK-NEXT: store i32 [[A:%.*]], i32* [[A_ADDR]], align 4 | ||
// CHECK-NEXT: ret void | ||
// | ||
void test(int a) | ||
{ | ||
} |
8 changes: 8 additions & 0 deletions
8
clang/test/utils/update_cc_test_checks/exec-all-runlines.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Test that non-clang/non-filechecked runlines execute | ||
|
||
# RUN: cp %S/Inputs/exec-all-runlines.c %t-generated.c && %update_cc_test_checks %t-generated.c | ||
# RUN: diff -u %S/Inputs/exec-all-runlines.c.expected %t-generated.c | ||
|
||
## Check that re-running update_cc_test_checks doesn't change the output | ||
# RUN: %update_cc_test_checks %t-generated.c | ||
# RUN: diff -u %S/Inputs/exec-all-runlines.c.expected %t-generated.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters