[gem5-dev] Change in gem5/gem5[master]: tests: add some pthread and std::thread unit tests
Tuan Ta has submitted this change and it was merged. ( https://gem5-review.googlesource.com/8221 ) Change subject: tests: add some pthread and std::thread unit tests .. tests: add some pthread and std::thread unit tests This patch adds some pthread and C++11 std::thread unit tests. Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 Reviewed-on: https://gem5-review.googlesource.com/8221 Reviewed-by: Jason Lowe-Power Maintainer: Brandon Potter --- A tests/test-progs/pthread/Makefile.riscv A tests/test-progs/pthread/Makefile.x86 A tests/test-progs/pthread/src/test_atomic.cpp A tests/test-progs/pthread/src/test_pthread_cond.cpp A tests/test-progs/pthread/src/test_pthread_create_para.cpp A tests/test-progs/pthread/src/test_pthread_create_seq.cpp A tests/test-progs/pthread/src/test_pthread_mutex.cpp A tests/test-progs/pthread/src/test_std_condition_variable.cpp A tests/test-progs/pthread/src/test_std_mutex.cpp A tests/test-progs/pthread/src/test_std_thread.cpp 10 files changed, 942 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved diff --git a/tests/test-progs/pthread/Makefile.riscv b/tests/test-progs/pthread/Makefile.riscv new file mode 100644 index 000..0122187 --- /dev/null +++ b/tests/test-progs/pthread/Makefile.riscv @@ -0,0 +1,32 @@ +CPP := riscv64-unknown-linux-gnu-g++ +OBJDUMP := riscv64-unknown-linux-gnu-objdump +CPPFLAGS := -g -O3 -static -std=c++11 -march=rv64gc +LFLAGS := -pthread -Wl,--whole-archive -lpthread -latomic -Wl,--no-whole-archive + +SRC_DIR := ./src +BIN_DIR := ./bin + +TEST_SRC := test_pthread_create_seq.cpp \ +test_pthread_create_para.cpp \ +test_pthread_mutex.cpp \ +test_atomic.cpp \ +test_pthread_cond.cpp \ +test_std_thread.cpp \ +test_std_mutex.cpp \ +test_std_condition_variable.cpp \ + +TEST_BIN := $(patsubst %.cpp,%,$(TEST_SRC)) +TEST_DUMP := $(patsubst %.cpp,%.objdump,$(TEST_SRC)) + +# Rules + +.PHONY: default clean + +default: $(TEST_BIN) + +$(TEST_BIN): + mkdir -p $(BIN_DIR) + $(CPP) $(CPPFLAGS) $(SRC_DIR)/$@.cpp $(LFLAGS) -o $(BIN_DIR)/$@ + +clean: + $(RM) -r $(BIN_DIR)/* diff --git a/tests/test-progs/pthread/Makefile.x86 b/tests/test-progs/pthread/Makefile.x86 new file mode 100644 index 000..7ad89f0 --- /dev/null +++ b/tests/test-progs/pthread/Makefile.x86 @@ -0,0 +1,34 @@ +# x86 - native + +CPP := g++ +OBJDUMP := objdump +CPPFLAGS := -g -O3 -static -std=c++11 +LFLAGS := -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive + +SRC_DIR := ./src +BIN_DIR := ./bin + +TEST_SRC := test_pthread_create_seq.cpp \ +test_pthread_create_para.cpp \ +test_pthread_mutex.cpp \ +test_atomic.cpp \ +test_pthread_cond.cpp \ +test_std_thread.cpp \ +test_std_mutex.cpp \ +test_std_condition_variable.cpp \ + +TEST_BIN := $(patsubst %.cpp,%,$(TEST_SRC)) +TEST_DUMP := $(patsubst %.cpp,%.objdump,$(TEST_SRC)) + +# Rules + +.PHONY: default clean + +default: $(TEST_BIN) + +$(TEST_BIN): + mkdir -p $(BIN_DIR) + $(CPP) $(CPPFLAGS) $(SRC_DIR)/$@.cpp $(LFLAGS) -o $(BIN_DIR)/$@ + +clean: + $(RM) -r $(BIN_DIR)/* diff --git a/tests/test-progs/pthread/src/test_atomic.cpp b/tests/test-progs/pthread/src/test_atomic.cpp new file mode 100644 index 000..edcb046 --- /dev/null +++ b/tests/test-progs/pthread/src/test_atomic.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018, Cornell University + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of Cornell University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAU
[gem5-dev] Change in gem5/gem5[master]: tests: add some pthread and std::thread unit tests
Hello Alec Roelke, Brandon Potter, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/8221 to look at the new patch set (#5). Change subject: tests: add some pthread and std::thread unit tests .. tests: add some pthread and std::thread unit tests This patch adds some pthread and C++11 std::thread unit tests. Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 --- A tests/test-progs/pthread/Makefile.riscv A tests/test-progs/pthread/Makefile.x86 A tests/test-progs/pthread/src/test_atomic.cpp A tests/test-progs/pthread/src/test_pthread_cond.cpp A tests/test-progs/pthread/src/test_pthread_create_para.cpp A tests/test-progs/pthread/src/test_pthread_create_seq.cpp A tests/test-progs/pthread/src/test_pthread_mutex.cpp A tests/test-progs/pthread/src/test_std_condition_variable.cpp A tests/test-progs/pthread/src/test_std_mutex.cpp A tests/test-progs/pthread/src/test_std_thread.cpp 10 files changed, 942 insertions(+), 0 deletions(-) -- To view, visit https://gem5-review.googlesource.com/8221 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 Gerrit-Change-Number: 8221 Gerrit-PatchSet: 5 Gerrit-Owner: Tuan Ta Gerrit-Reviewer: Alec Roelke Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Tuan Ta Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: add some pthread and std::thread unit tests
Hello Alec Roelke, Brandon Potter, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/8221 to look at the new patch set (#4). Change subject: tests: add some pthread and std::thread unit tests .. tests: add some pthread and std::thread unit tests This patch adds some pthread and C++11 std::thread unit tests. Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 --- A tests/test-progs/pthread/Makefile.riscv A tests/test-progs/pthread/Makefile.x86 A tests/test-progs/pthread/src/test_atomic.cpp A tests/test-progs/pthread/src/test_pthread_cond.cpp A tests/test-progs/pthread/src/test_pthread_create_para.cpp A tests/test-progs/pthread/src/test_pthread_create_seq.cpp A tests/test-progs/pthread/src/test_pthread_mutex.cpp A tests/test-progs/pthread/src/test_std_condition_variable.cpp A tests/test-progs/pthread/src/test_std_mutex.cpp A tests/test-progs/pthread/src/test_std_thread.cpp 10 files changed, 948 insertions(+), 0 deletions(-) -- To view, visit https://gem5-review.googlesource.com/8221 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 Gerrit-Change-Number: 8221 Gerrit-PatchSet: 4 Gerrit-Owner: Tuan Ta Gerrit-Reviewer: Alec Roelke Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Tuan Ta Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: add some pthread and std::thread unit tests
Hello Alec Roelke, Brandon Potter, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/8221 to look at the new patch set (#3). Change subject: tests: add some pthread and std::thread unit tests .. tests: add some pthread and std::thread unit tests This patch adds some pthread and C++11 std::thread unit tests. Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 --- A tests/test-progs/pthread/Makefile A tests/test-progs/pthread/src/test_atomic.cpp A tests/test-progs/pthread/src/test_pthread_cond.cpp A tests/test-progs/pthread/src/test_pthread_create_para.cpp A tests/test-progs/pthread/src/test_pthread_create_seq.cpp A tests/test-progs/pthread/src/test_pthread_mutex.cpp A tests/test-progs/pthread/src/test_std_condition_variable.cpp A tests/test-progs/pthread/src/test_std_mutex.cpp A tests/test-progs/pthread/src/test_std_thread.cpp 9 files changed, 914 insertions(+), 0 deletions(-) -- To view, visit https://gem5-review.googlesource.com/8221 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 Gerrit-Change-Number: 8221 Gerrit-PatchSet: 3 Gerrit-Owner: Tuan Ta Gerrit-Reviewer: Alec Roelke Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Tuan Ta Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: add some pthread and std::thread unit tests
Hello Alec Roelke, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/8221 to look at the new patch set (#2). Change subject: tests: add some pthread and std::thread unit tests .. tests: add some pthread and std::thread unit tests This patch adds some pthread and C++11 std::thread unit tests. Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 --- A tests/test-progs/pthread/Makefile A tests/test-progs/pthread/src/test_atomic.cpp A tests/test-progs/pthread/src/test_pthread_cond.cpp A tests/test-progs/pthread/src/test_pthread_create_para.cpp A tests/test-progs/pthread/src/test_pthread_create_seq.cpp A tests/test-progs/pthread/src/test_pthread_mutex.cpp A tests/test-progs/pthread/src/test_std_condition_variable.cpp A tests/test-progs/pthread/src/test_std_mutex.cpp A tests/test-progs/pthread/src/test_std_thread.cpp 9 files changed, 938 insertions(+), 0 deletions(-) -- To view, visit https://gem5-review.googlesource.com/8221 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I9706b542e5fa927a87c6e8ae2a6330fab7bb5d72 Gerrit-Change-Number: 8221 Gerrit-PatchSet: 2 Gerrit-Owner: Tuan Ta Gerrit-Reviewer: Alec Roelke Gerrit-Reviewer: Tuan Ta Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev