1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2 ; RUN: opt < %s -nary-reassociate -S | FileCheck %s 3 4 ; The test check that compilation does not fall into infinite loop. 5 6 define i8 @foo(i8 %v) local_unnamed_addr #0 { 7 ; CHECK-LABEL: @foo( 8 ; CHECK-NEXT: region.0: 9 ; CHECK-NEXT: [[TMP0:%.*]] = mul nsw i8 16, [[V:%.*]] 10 ; CHECK-NEXT: [[TMP1:%.*]] = mul nsw i8 0, [[TMP0]] 11 ; CHECK-NEXT: [[TMP2:%.*]] = mul nsw i8 1, [[TMP1]] 12 ; CHECK-NEXT: ret i8 [[TMP2]] 13 ; 14 region.0: 15 %0 = mul nsw i8 16, %v 16 %1 = mul nsw i8 0, %0 17 %2 = mul nsw i8 1, %1 18 ret i8 %2 19 } 20