ir-support.c 587 B

12345678910111213141516171819
  1. // Test that we can consume LLVM IR/bitcode in the frontend and produce
  2. // equivalent output to a standard compilation.
  3. // We strip differing '.file' directives before comparing.
  4. // Reference output:
  5. // RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
  6. // LLVM bitcode:
  7. // RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
  8. // RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
  9. // RUN: diff %t.s %t.bc.s
  10. // LLVM IR source code:
  11. // RUN: %clang_cc1 -emit-llvm -o %t.ll %s
  12. // RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
  13. // RUN: diff %t.s %t.ll.s
  14. int f() { return 0; }