This is an archive of the discontinued LLVM Phabricator instance.

Introduce the feature "linux" for tests only for linux
AbandonedPublic

Authored by twoh on Mar 3 2017, 1:37 PM.

Details

Reviewers
filcab
chapuni
Summary

This feature is needed to re-enable rL293004, which resembles gcc's behavior in
finding the input file name from a preprocessed source. The patch has been
reverted in rL293032, because the test checks FILE symbol of ELF file, which is
not valid on OSes not using ELF. With the patch, we can add "REQUIRES: linux"
to the tests on ELF files, or tests that require any linux-specific features.

Event Timeline

twoh created this revision.Mar 3 2017, 1:37 PM

Checking for linux when really you want to check for ELF doesn't seem right. In this case, I think there is an better way to do it; instead of relying on llvm-objdump, could you emit an LLVM assembly file and check that for presence of the string you want? I think if you compile with clang -g -S -emit-llvm, it will give you LLVM assembly with metadata for the records you need and you won't need to generate an object file.

twoh abandoned this revision.Mar 3 2017, 11:25 PM

@inglorion That makes a lot of sense. Maybe we don't even need -g, because -S -emit-llvm shows source_filename. I'll run some more experiments with relpath/abspath and debug locations, and submit a revised patch. Thanks for the comment!