52 lines · plain
1; RUN: llc -mtriple=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s2;3; Source:4; extern void foo(void) __attribute__((nomerge));5;6; void bar(long i) {7; if (i)8; foo();9; else10; foo();11; }12;13; Compilation flag:14; clang -target bpf -S -O2 -emit-llvm t.c -o t.ll15 16; The goal of the test is to check that 'nomerge' attribute17; preserves two calls to 'foo' from merging.18 19; CHECK: call foo20; CHECK: call foo21 22; Function Attrs: nounwind23define dso_local void @bar(i64 noundef %i) local_unnamed_addr #0 {24entry:25 %tobool.not = icmp eq i64 %i, 026 br i1 %tobool.not, label %if.else, label %if.then27 28if.then: ; preds = %entry29 tail call void @foo() #230 br label %if.end31 32if.else: ; preds = %entry33 tail call void @foo() #234 br label %if.end35 36if.end: ; preds = %if.else, %if.then37 ret void38}39 40declare dso_local void @foo() local_unnamed_addr #141 42attributes #0 = { nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }43attributes #1 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }44attributes #2 = { nomerge nounwind }45 46!llvm.module.flags = !{!0, !1}47!llvm.ident = !{!2}48 49!0 = !{i32 1, !"wchar_size", i32 4}50!1 = !{i32 7, !"frame-pointer", i32 2}51!2 = !{!"clang version 17.0.0 (/home/eddy/work/llvm-project/clang bd66f4b1da304af8e5a890b3205ce6f3d76667ee)"}52