Skip to content

Commit

Permalink
Fixed the test and its formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gbMattN committed Nov 18, 2024
1 parent a2561d5 commit d93e959
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions compiler-rt/test/tsan/many_held_mutex.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// RUN: %clangxx_tsan %s -fsanitize=thread -o %t && %run %t 2>&1 | Filecheck %s
// RUN: %clangxx_tsan %s -fsanitize=thread -o %t && %run %t 2>&1 | FileCheck %s

#include <mutex>
#include <stdio.h>

int main(){
const unsigned short NUM_OF_MTX = 128;
std::mutex mutexes[NUM_OF_MTX];
int main() {
const unsigned short NUM_OF_MTX = 128;
std::mutex mutexes[NUM_OF_MTX];

for(int i = 0; i < NUM_OF_MTX; i++){
mutexes[i].lock();
}
for(int i = 0; i < NUM_OF_MTX; i++){
mutexes[i].unlock();
}
for (int i = 0; i < NUM_OF_MTX; i++) {
mutexes[i].lock();
}
for (int i = 0; i < NUM_OF_MTX; i++) {
mutexes[i].unlock();
}

printf("Success\n");
printf("Success\n");

return 0;
return 0;
}

// CHECK: Success
Expand Down

0 comments on commit d93e959

Please sign in to comment.