This is an archive of the discontinued LLVM Phabricator instance.

Fix some rtti-options tests
ClosedPublic

Authored by Sunil_Srivastava on May 14 2018, 9:50 AM.

Details

Summary

Certain tests in rtti-options.cpp are not really testing anything because they are testing for the absence of -frtti option to the cc1 process. Since the cc1 process does not take -frtti option, these tests are passing tautologically.

The RTTI mode is enabled by default in cc1, and -fno-rtti disables it. Therefore the correct way to check for enabling of RTTI is to check for the absence of -fno-rtti to cc1, and the correct way to check for disabling of RTTI is to check for the presence of -fno-rtti to cc1.

This patch fixes those tests.

Diff Detail

Repository
rC Clang

Event Timeline

Sunil_Srivastava removed a subscriber: filcab.
filcab accepted this revision.May 15 2018, 6:58 AM

LGTM

test/Driver/rtti-options.cpp
13

Minor nit: I like saving space like that, but I think it might be slightly confusing for someone reading this, as the -NOT suffix is special in FileCheck. I don't think this is a huge problem as we have the single CHECK line, and we don't end up using ...-NOT-NOT anyway.
Feel free to keep or change as you want.

This revision is now accepted and ready to land.May 15 2018, 6:58 AM
This revision was automatically updated to reflect the committed changes.