-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Patmos][Clang] Can now compile only object or archive files without …
…any .c files.
- Loading branch information
Showing
7 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
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
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,23 @@ | ||
// RUN: %clang --target=patmos %S/helpers/helper-function.c -c -o %t-object.o | ||
// RUN: %clang --target=patmos %S/helpers/helper-function2.c -c -o %t-object2.o | ||
// RUN: ar cr %t-archive.a %t-object.o %t-object2.o | ||
// RUN: %clang --target=patmos %s -c -o %t-object3.o | ||
// RUN: ar cr %t-archive2.a %t-object3.o | ||
// RUN: %clang -v --target=patmos %t-archive.a %t-archive2.a -o %t | ||
// RUN: llvm-objdump -rd %t | FileCheck %s | ||
// END. | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tests can compile only archive files | ||
// | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
// CHECK-DAG: <helper_source_function> | ||
extern int helper_source_function(int x); | ||
// CHECK-DAG: <helper_source_function2> | ||
extern int helper_source_function2(int x); | ||
|
||
// CHECK-DAG: <main> | ||
int main(int x) { | ||
return helper_source_function(helper_source_function2(x)); | ||
} |
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,14 @@ | ||
// RUN: %clang --target=patmos %S/helpers/helper-main.c -c -o %t-object.o | ||
// RUN: %clang --target=patmos %S/helpers/helper-function.c -c -o %t-object2.o | ||
// RUN: %clang --target=patmos %t-object.o %t-object2.o -o %t | ||
// RUN: llvm-objdump -rd %t | FileCheck %s | ||
// END. | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tests can compile only an object files | ||
// | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
// CHECK-DAG: <main> | ||
// CHECK-DAG: <helper_source_function> | ||
|
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 @@ | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// This is a helper .c file that isn't itself a test. | ||
// | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
volatile int HELPER_SOURCE_INT_1 = 1; | ||
|
||
int main() { | ||
return HELPER_SOURCE_INT_1; | ||
} |