secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
933 stars 140 forks source link

/usr/local/llvm14/bin/opt: array_01_cpp_m2r_dbg.ll:13:16: error: expected type #604

Closed yurivict closed 1 year ago

yurivict commented 1 year ago

Bug description

Build fails on FreeBSD 14-CURRENT:

[ 31% 237/760] cd /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array && /usr/bin/c++ -std=c++17 -fno-discard-value-names -emit-llvm -S -Xclang -disable-O0-optnone -g /wrkdirs/usr/ports/devel/phasar/work/phasar-1222/test/llvm_test_code/constness/array/array_01.cpp -o array_01_cpp_m2r_dbg.ll && /usr/local/llvm14/bin/opt -mem2reg -S array_01_cpp_m2r_dbg.ll -o array_01_cpp_m2r_dbg.ll
FAILED: test/llvm_test_code/constness/array/array_01_cpp_m2r_dbg.ll /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array/array_01_cpp_m2r_dbg.ll 
cd /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array && /usr/bin/c++ -std=c++17 -fno-discard-value-names -emit-llvm -S -Xclang -disable-O0-optnone -g /wrkdirs/usr/ports/devel/phasar/work/phasar-1222/test/llvm_test_code/constness/array/array_01.cpp -o array_01_cpp_m2r_dbg.ll && /usr/local/llvm14/bin/opt -mem2reg -S array_01_cpp_m2r_dbg.ll -o array_01_cpp_m2r_dbg.ll
array_01_cpp_m2r_dbg.ll:13:16: warning: ptr type is only supported in -opaque-pointers mode
  store i32 0, ptr %retval, align 4
               ^
/usr/local/llvm14/bin/opt: array_01_cpp_m2r_dbg.ll:13:16: error: expected type
  store i32 0, ptr %retval, align 4
               ^

Steps to reproduce

Regular build

Context (Environment)

Operating System:

Build Type:

Possible solution

We are happy to discuss possible solutions to this problem, especially if it origniates from a design flaw.

Example files

Files:

fabianbs96 commented 1 year ago

Hi @yurivict, this is an issue that we have also observed ourselves. This comes when you compile phasar with a clang version >14. Then it compiles the LLVM test files for our unittests with that version as well. As phasar is currently set up to support LLVM 14, there is a compatibility issue. There are several ways to resolve this issue:

This issue will be fixed by #516