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