I chose to encode the allockind information in a string constant because otherwise we would get a bit of an explosion of keywords to deal with the possible permutations of allocation function types. I'm not sure that CodeGen.h is the correct place for this enum, but it seemed to kind of match the UWTableKind enum so I put it in the same place. Constructive suggestions on a better location most certainly encouraged. Differential Revision: https://reviews.llvm.org/D123088
17 lines
676 B
LLVM
17 lines
676 B
LLVM
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
|
|
declare i8* @a(i32) allockind("aligned")
|
|
|
|
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
|
|
declare i8* @b(i32*) allockind("free,realloc")
|
|
|
|
; CHECK: 'allockind("free")' doesn't allow uninitialized, zeroed, or aligned modifiers.
|
|
declare i8* @c(i32) allockind("free,zeroed")
|
|
|
|
; CHECK: 'allockind()' can't be both zeroed and uninitialized
|
|
declare i8* @d(i32, i32*) allockind("realloc,uninitialized,zeroed")
|
|
|
|
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
|
|
declare i8* @e(i32, i32) allockind("alloc,free")
|