]> granicus.if.org Git - llvm/commitdiff
Fix test and add missing return for llvm-lto2 error case
authorTeresa Johnson <tejohnson@google.com>
Tue, 7 Mar 2017 18:15:13 +0000 (18:15 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 7 Mar 2017 18:15:13 +0000 (18:15 +0000)
Summary:
This test was missing the target triple.
Once I fixed that, the case with the invalid character error stopped
returning 1 from llvm-lto2 and the test reported a failure. Fixed by
adding the missing return from llvm-lto2. Apparently we were failing
when we eventually tried to get the target.

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30585

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297173 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-lto2/errors.ll
tools/llvm-lto2/llvm-lto2.cpp

index 25c05430c935c8d02d1287877aa8f13edb8275b5..bc1f767d14f6eaa10179ef78e2c62b6233ccf388 100644 (file)
@@ -10,5 +10,6 @@
 ; ERR4: invalid resolution: foo
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
 
 @foo = global i32 0
index 4b3251545e34b50ec49edd34d5443082e61248dc..3fe0487476f78a39b8b6450289e2d77ac7aafb3d 100644 (file)
@@ -157,9 +157,11 @@ int main(int argc, char **argv) {
         Res.FinalDefinitionInLinkageUnit = true;
       else if (C == 'x')
         Res.VisibleToRegularObj = true;
-      else
+      else {
         llvm::errs() << "invalid character " << C << " in resolution: " << R
                      << '\n';
+        return 1;
+      }
     }
     CommandLineResolutions[{FileName, SymbolName}].push_back(Res);
   }