2021-10-18 14:01:51 +00:00
|
|
|
#!/bin/sh -eux
|
2021-04-14 02:01:54 +00:00
|
|
|
|
|
|
|
# Tests for using a full LLVM toolchain: clang + compiler-rt + libcxx + lld
|
|
|
|
|
2021-10-18 14:01:51 +00:00
|
|
|
set pipefail
|
2021-04-14 02:01:54 +00:00
|
|
|
|
|
|
|
# Test compile a C program.
|
|
|
|
cat << EOF | \
|
|
|
|
clang -fuse-ld=lld -rtlib=compiler-rt -x c - && \
|
|
|
|
./a.out | grep 'Hello World'
|
|
|
|
|
|
|
|
#include<stdio.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
printf("Hello World\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Test compile a C++ program.
|
|
|
|
cat << EOF | \
|
|
|
|
clang++ -x c++ -fuse-ld=lld -rtlib=compiler-rt -stdlib=libc++ - && \
|
|
|
|
./a.out | grep 'Hello World'
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
std::cout << "Hello World\n";
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|