Skip to content

Commit

Permalink
test: Enable objectfile tests only when %cc is set to clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko authored and xlauko committed Aug 6, 2024
1 parent e2cad07 commit ba62513
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
tool.command = os.path.join(*path, tool.command)
llvm_config.add_tool_substitutions([tool])

if config.host_cc.find('clang') != -1:
config.available_features.add("clang")

stdbit_test = subprocess.run(["cc", "-x", "c", "-", "-o", "/dev/null"],
input=b'#include <stdbit.h>\n int main() {}',
capture_output=True)
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/call-struct-float-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && %t | %file-check %s.driver
// REQUIRES: clang

struct d_data
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/call-struct-float-b.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && %t | %file-check %s.driver
// REQUIRES: clang

struct wrap
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/float-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

float float_sum(float a, float b)
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/identity-a.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

int identity(int a) { return a; }
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/struct-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct Data
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/struct-b.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct W_i16
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/void-return-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -c -vast-pipeline=with-abi -o %t.vast.o %s && %cc -c -xc %s.driver -o %t.clang.o && %cc %t.vast.o %t.clang.o -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

void nothing(int a) {}

Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/call-array-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -vast-pipeline=with-abi -S -emit-llvm -o %t.vast.ll %s && %cc -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

int sum(int array[2])
{
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/call-array-b.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -S -emit-llvm -o %t.vast.ll %s && %cc -target x86_64 -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct data {
int array[4];
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/call-array-c.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -S -emit-llvm -o %t.vast.ll %s && %cc -target x86_64 -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct data {
short a;
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/call-array-d.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -S -emit-llvm -o %t.vast.ll %s && %cc -target x86_64 -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

// Issue #605
// REQUIRES: abi-float-vectors
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/one-element-array-a.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -S -emit-llvm -o %t.vast.ll %s && %cc -target x86_64 -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct data {
int array[1];
Expand Down
1 change: 1 addition & 0 deletions test/vast/Compile/ObjectFiles/x86_64/one-element-array-b.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %vast-front -target x86_64 -c -S -emit-llvm -o %t.vast.ll %s && %cc -target x86_64 -c -S -emit-llvm -xc %s.driver -o %t.clang.ll && %cc %t.vast.ll %t.clang.ll -o %t && (%t; test $? -eq 0)
// REQUIRES: clang

struct data {
float array[1];
Expand Down

0 comments on commit ba62513

Please sign in to comment.