summaryrefslogtreecommitdiff
path: root/t/ltcond2.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-12-18 11:30:39 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-12-18 11:30:50 +0100
commita1f9336b9dee4dcb97dd8488f22b1bc684f956f9 (patch)
tree82f214e18766a2b0d031c614ef5c496ee0ce7e45 /t/ltcond2.sh
parentfba280d0923da6ef0d55db11edb0944ee1261987 (diff)
downloadautomake-a1f9336b9dee4dcb97dd8488f22b1bc684f956f9.tar.gz
tests: avoid a spurious failure due to a Clang bug
This version of clang: clang version 3.2 (trunk 163574) Target: powerpc64-unknown-linux-gnu Thread model: posix caused the test 't/ltcond2.sh' to spuriously fail due to what appeared like a clang bug. Here is a part of the diagnostic (trimmed down for better clarity): clang: .../cfarm/llvm/lib/MC/MCAsmStreamer.cpp:338: \ virtual void {anonymous}::MCAsmStreamer::EmitLabel(llvm::MCSymbol*): \ Assertion `Symbol->isUndefined() && "Cannot define a symbol twice!"' \ failed. ... 7 clang 0x0000000012a459c4 llvm::AsmPrinter::EmitGlobalVariable\ (llvm::GlobalVariable const*) + 18446744073680468044 8 clang 0x0000000012a490a8 llvm::AsmPrinter::doFinalization\ (llvm::Module&) + 18446744073680481840 ... Stack dump: 0. Program arguments: .../opt/cfarm/clang-2012.09.10/bin/clang \ -cc1 -triple powerpc64-unknown-linux-gnu -S -disable-free \ ... 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'hello-generic.c'. clang: error: unable to execute command: Aborted clang: error: clang frontend command failed due to signal (use -v to \ see invocation) clang version 3.2 (trunk 163574) Target: powerpc64-unknown-linux-gnu Thread model: posix So tweak the affected test case to avoid triggering this bug. This is the easiest way for us to keep the testsuite result clean and meaningful on our main Clang test bed. * t/ltcond2.sh: Prefer using "extern const char *" variables rather than functions returning a statically allocated "const char *" variable. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/ltcond2.sh')
-rwxr-xr-xt/ltcond2.sh14
1 files changed, 4 insertions, 10 deletions
diff --git a/t/ltcond2.sh b/t/ltcond2.sh
index a16a7cfe7..48edede78 100755
--- a/t/ltcond2.sh
+++ b/t/ltcond2.sh
@@ -56,25 +56,19 @@ check-local:
END
cat > hello-linux.c <<'END'
-const char* str (void)
-{
- return "hello-linux";
-}
+const char* str = "hello-linux";
END
cat > hello-generic.c <<'END'
-const char* str (void)
-{
- return "hello-generic";
-}
+const char* str = "hello-generic";
END
cat > hello-common.c <<'END'
#include <stdio.h>
-const char* str (void);
+extern const char* str;
void print (void)
{
- puts (str ());
+ puts (str);
}
END