[PATCH] Fix CodeGen/PowerPC/stack-protector.ll test case on OpenBSD

Hal Finkel hfinkel at anl.gov
Mon Jun 24 15:24:50 PDT 2013


----- Original Message -----
> On OpenBSD, the stack smash protection transform uses "__guard_local"
> and "__stack_smash_handler" instead of "__stack_chk_guard" and
> "__stack_chk_fail".  However, CodeGen/PowerPC/stack-protector.ll
> doesn't specify a target OS, so on OpenBSD it fails.
> 
> Easy fix: Add -mtriple=ppc32-unknown-linux to make the test more host
> OS agnostic.
> 
> While here, it's easy enough to switch to FileCheck so llc only needs
> to run once.  I think this is a win?

I don't think that you need the '-o -' part because you're feeding llc from stdin. Otherwise, LGTM. Thanks!

 -Hal

> 
> Index: llvm/test/CodeGen/PowerPC/stack-protector.ll
> ===================================================================
> --- llvm/test/CodeGen/PowerPC/stack-protector.ll	(revision 184494)
> +++ llvm/test/CodeGen/PowerPC/stack-protector.ll	(working copy)
> @@ -1,5 +1,6 @@
> -; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_guard"
> -; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_fail"
> +; RUN: llc -march=ppc32 -mtriple=ppc32-unknown-linux < %s -o - |
> FileCheck %s
> +; CHECK: __stack_chk_guard
> +; CHECK: __stack_chk_fail
>  
>  @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00"		; <[11 x
>  i8]*> [#uses=1]
>  
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list