Skip to content

Commit 30c4b97

Browse files
committed
[test] Fix unit test case errors.
This fix includes two changes: - use proper triple name for arm: arm-unknown-linux-gnueabi - specify output to be in a temp directory Test cases fixed: - clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c - clang/test/Driver/fsplit-machine-functions.c - clang/test/Driver/fsplit-machine-functions2.c Reviewed: xur
1 parent 51b65d0 commit 30c4b97

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@
55

66
// Check that -fsplit-machine-functions is passed to both x86 and cuda
77
// compilation and does not cause driver error.
8+
// RUN: cd "$(dirname "%t")" ; \
89
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
9-
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s 2>&1 \
10-
// RUN: | FileCheck %s --check-prefix=MFS1
10+
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s \
11+
// RUN: 2>&1 | FileCheck %s --check-prefix=MFS1
1112
// MFS1: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
1213
// MFS1: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
1314

1415
// Check that -fsplit-machine-functions is passed to cuda and it
1516
// causes a warning.
17+
// RUN: cd "$(dirname "%t")" ; \
1618
// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
17-
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s 2>&1 \
18-
// RUN: | FileCheck %s --check-prefix=MFS2
19+
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s \
20+
// RUN: 2>&1 | FileCheck %s --check-prefix=MFS2
1921
// MFS2: warning: -fsplit-machine-functions is not valid for nvptx
2022

2123
// Check that -Xarch_host -fsplit-machine-functions is passed only to
2224
// native compilation.
25+
// RUN: cd "$(dirname "%t")" ; \
2326
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
2427
// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \
2528
// RUN: -fsplit-machine-functions -S %s \
@@ -28,6 +31,7 @@
2831
// MFS3-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
2932

3033
// Check that -Xarch_host -fsplit-machine-functions does not cause any warning.
34+
// RUN: cd "$(dirname "%t")" ; \
3135
// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
3236
// RUN --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \
3337
// RUN -fsplit-machine-functions -S %s || { echo \
@@ -36,6 +40,7 @@
3640
// MFS4-NOT: warning: -fsplit-machine-functions is not valid for
3741

3842
// Check that -Xarch_device -fsplit-machine-functions does cause the warning.
43+
// RUN: cd "$(dirname "%t")" ; \
3944
// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
4045
// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_device \
4146
// RUN: -fsplit-machine-functions -S %s 2>&1 | \
@@ -44,6 +49,7 @@
4449

4550
// Check that -fsplit-machine-functions -Xarch_device
4651
// -fno-split-machine-functions only passes MFS to x86
52+
// RUN: cd "$(dirname "%t")" ; \
4753
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
4854
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \
4955
// RUN: -Xarch_device -fno-split-machine-functions -S %s \
@@ -53,6 +59,7 @@
5359

5460
// Check that -fsplit-machine-functions -Xarch_device
5561
// -fno-split-machine-functions has no warnings
62+
// RUN: cd "$(dirname "%t")" ; \
5663
// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
5764
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \
5865
// RUN: -Xarch_device -fno-split-machine-functions -S %s \

clang/test/Driver/fsplit-machine-functions.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: arm-registered-target
22

3-
// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
4-
// RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
5-
// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
6-
// RUN: %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
3+
// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
4+
// RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
5+
// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
6+
// RUN: %clang -c -target arm-unknown-linux-gnueabi -fsplit-machine-functions %s -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
77

88
// CHECK-OPT: "-fsplit-machine-functions"
99
// CHECK-NOOPT-NOT: "-fsplit-machine-functions"

clang/test/Driver/fsplit-machine-functions2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Test -fsplit-machine-functions option pass-through with lto
2-
// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
2+
// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions %s -o %t.o 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
33

44
// Test no pass-through to ld without lto
5-
// RUN: %clang -### -target x86_64-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
5+
// RUN: %clang -### -target x86_64-unknown-linux -fsplit-machine-functions %s -o %t.o 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
66

77
// Test the mix of -fsplit-machine-functions and -fno-split-machine-functions
8-
// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
9-
// RUN: %clang -### -target x86_64-unknown-linux -flto -fno-split-machine-functions -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
8+
// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s -o %t.o 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
9+
// RUN: %clang -### -target x86_64-unknown-linux -flto -fno-split-machine-functions -fsplit-machine-functions %s -o %t.o 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
1010
// Check that for non-X86, passing no-split-machine-functions does not cause error.
11-
// RUN: %clang -### -target aarch64-unknown-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS2
11+
// RUN: %clang -### -target aarch64-unknown-linux-gnu -flto -fsplit-machine-functions -fno-split-machine-functions %s -o %t.o 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS2
1212

1313
// CHECK-PASS: "-plugin-opt=-split-machine-functions"
1414
// CHECK-NOPASS-NOT: "-plugin-opt=-split-machine-functions"

0 commit comments

Comments
 (0)